text/x-python;application/x-python;text/x-python3
*.py;*.py3;*.pyi
#
.py
(\.[\s\n\r]*[\w]+)[\s\n\r]*(?=\(.*\))
(?> (?: _ | \%{def:unicode-xid-start} ) \%{def:unicode-xid-continue}* )
[1-9][0-9]*
(\%{identifier}\.)*\%{identifier}
(\.*\%{identifier-path}|\.+)
(\.[\s\n\r]*[\w]+)[\s\n\r]*(?=\(.*\))
% # leading % sign
\(\%{identifier}\)? # mapping key
[#0\-\ \+]* # conversion flags
(\-?\%{number}|\*)? # minimum field width
(\.(\-?\%{number}|\*))? # precision
(hlL)? # length modifier
[diouxXeEfFgGcrs%] # conversion type
\{
\}
(\{)
(\})
\{\{
(b|B)?
(r|R|rb|RB|rB|Rb|br|BR|bR|Br)
(f|F)
\%{string-prefix}"""
"""
\%{string-prefix}'''
'''
\%{string-prefix}"
"
\%{string-prefix}'
'
(\%{f-string-prefix}""")
(""")
.
(\%{f-string-prefix}''')
(''')
.
(\%{f-string-prefix}")
(")
.
(\%{f-string-prefix}')
(')
.
\%{raw-string-prefix}"""
"""
\%{raw-string-prefix}'''
'''
\%{raw-string-prefix}"
"
\%{raw-string-prefix}'
'
(from)
\s+
(\%{relative-path})
(def)
\s+
(\%{identifier})
(class)
\s+
(\%{identifier})
@\%{identifier-path}
(?<![\w\.])([1-9](_?[0-9])*|0)(?![\w\.])
(?<![\w\.])0[bB](_?[0-1])+(?![\w\.])
(?<![\w\.])0[oO](_?[0-7])+(?![\w\.])
(?<![\w\.])0[xX](_?[0-9A-Fa-f])+(?![\w\.])
async
await
nonlocal
match
case
(?<![\w\.])
ResourceWarning
(?<![\w\.])
ascii
bin
breakpoint
bytearray
bytes
exec
format
memoryview
next
print