text/x-python;application/x-python
*.py
#
[_a-zA-Z][_a-zA-Z0-9]*
[1-9][0-9]*
% # leading % sign
\(\%{identifier}\)? # mapping key
[#0\-\ \+]* # conversion flags
(\-?\%{number}|\*)? # minimum field width
(\.(\-?\%{number}|\*))? # precision
(hlL)? # lentgh modifier
[diouxXeEfFgGcrs%] # conversion type
\\( # leading backslash
[\\'"abfnrtv] | # single escaped char
N\{[A-Z\ ]+\} | # named unicode character
u[0-9A-Fa-f]{4} | # xxxx - character with 16-bit hex value xxxx
U[0-9A-Fa-f]{8} | # xxxxxxxx - character with 32-bit hex value xxxxxxxx
x[0-9A-Fa-f]{1,2} | # \xhh - character with hex value hh
[0-7]{1,3} # \ooo - character with octal value ooo
)
(u|U)?
(r|ur|R|UR|Ur|uR)
\%{string-prefix}"""
"""
\%{string-prefix}'''
'''
\%{string-prefix}"
"
\%{string-prefix}'
'
\%{raw-string-prefix}"""
"""
\%{raw-string-prefix}'''
'''
\%{raw-string-prefix}"
"
\%{raw-string-prefix}'
'
`
`
(?<![\w\.])
self
__name__
__debug__
(?<![\w\.])
False
True
( (\d+)?\.\d+ | \d+\. ) |
( (\d+|(\d+)?\.\d+|\d+\.)[eE][+-]?\d+ )
(?<![\w\.])(\%{float}|\d+)[jJ]\b
(?<![\w\.])\%{float}(?![\w\.])
(?<![\w\.])([1-9][0-9]*|0)[lL]?(?![\w\.])
(?<![\w\.])0[0-7]+[lL]?(?![\w\.])
(?<![\w\.])0[xX][0-9A-Fa-f]+[lL]?(?![\w\.])
import
from
as
and
assert
break
class
continue
def
del
elif
else
except
exec
finally
for
global
if
in
is
lambda
not
or
pass
print
raise
return
try
while
with
yield
(?<![\w\.])
Ellipsis
None
NotImplemented
(?<![\w\.])
ArithmeticError
AssertionError
AttributeError
EnvironmentError
EOFError
Exception
FloatingPointError
ImportError
IndentationError
IndexError
IOError
KeyboardInterrupt
KeyError
LookupError
MemoryError
NameError
NotImplementedError
OSError
OverflowError
ReferenceError
RuntimeError
StandardError
StopIteration
SyntaxError
SystemError
SystemExit
TabError
TypeError
UnboundLocalError
UnicodeDecodeError
UnicodeEncodeError
UnicodeError
UnicodeTranslateError
ValueError
WindowsError
ZeroDivisionError
Warning
UserWarning
DeprecationWarning
PendingDeprecationWarning
SyntaxWarning
OverflowWarning
RuntimeWarning
FutureWarning
(?<![\w\.])
__import__
abs
all
any
apply
basestring
bool
buffer
callable
chr
classmethod
cmp
coerce
compile
complex
delattr
dict
dir
divmod
enumerate
eval
execfile
file
filter
float
frozenset
getattr
globals
hasattr
hash
hex
id
input
int
intern
isinstance
issubclass
iter
len
list
locals
long
map
max
min
object
oct
open
ord
pow
property
range
raw_input
reduce
reload
repr
reversed
round
setattr
set
slice
sorted
staticmethod
str
sum
super
tuple
type
unichr
unicode
vars
xrange
zip