Skip to content

Commit e036a4c

Browse files
committed
Be explicit about builtin functions
1 parent 95fcb49 commit e036a4c

File tree

2 files changed

+85
-32
lines changed

2 files changed

+85
-32
lines changed

syntax/python.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ endif
341341
"
342342

343343
if s:Enabled('g:python_highlight_builtin_funcs')
344-
let s:funcs_re = '__import__|abs|all|any|bin|callable|chr|classmethod|compile|complex|delattr|dir|divmod|enumerate|eval|filter|format|getattr|globals|hasattr|hash|help|hex|id|input|isinstance|issubclass|iter|len|locals|map|max|min|memoryview|next|oct|open|ord|pow|property|range|repr|reversed|round|setattr|slice|sorted|staticmethod|sum|super|type|vars|zip'
344+
let s:funcs_re = '__import__|abs|all|any|bin|callable|chr|classmethod|compile|complex|delattr|dir|divmod|enumerate|eval|filter|format|getattr|globals|hasattr|hash|help|hex|id|input|isinstance|issubclass|iter|len|locals|map|max|memoryview|min|next|oct|open|ord|pow|property|range|repr|reversed|round|setattr|slice|sorted|staticmethod|sum|super|type|vars|zip'
345345

346346
if s:Python2Syntax()
347347
let s:funcs_re .= '|apply|basestring|buffer|cmp|coerce|execfile|file|intern|long|raw_input|reduce|reload|unichr|unicode|xrange'

tests/test.py

Lines changed: 84 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,46 +42,99 @@ async def Test
4242

4343
bool bytearray dict float frozenset int list object set str tuple
4444

45-
# Builtin functions: Python 2
45+
# Builtin functions
46+
47+
__import__()
48+
abs()
49+
all()
50+
any()
51+
bin()
52+
bool()
53+
bytearray()
54+
callable()
55+
chr()
56+
classmethod()
57+
compile()
58+
complex()
59+
delattr()
60+
dict()
61+
dir()
62+
divmod()
63+
enumerate()
64+
eval()
65+
filter()
66+
float()
67+
format()
68+
frozenset()
69+
getattr()
70+
globals()
71+
hasattr()
72+
hash()
73+
help()
74+
hex()
75+
id()
76+
input()
77+
int()
78+
isinstance()
79+
issubclass()
80+
iter()
81+
len()
82+
list()
83+
locals()
84+
map()
85+
max()
86+
memoryview()
87+
min()
88+
next()
89+
object()
90+
oct()
91+
open()
92+
ord()
93+
pow()
94+
property()
95+
range()
96+
repr()
97+
reversed()
98+
round()
99+
set()
100+
setattr()
101+
slice()
102+
sorted()
103+
staticmethod()
104+
str()
105+
sum()
106+
super()
107+
tuple()
108+
type()
109+
vars()
110+
zip()
46111

47-
abs() divmod() input() open() staticmethod()
48-
all() enumerate() int() ord() str()
49-
any() eval() isinstance() pow() sum()
50-
basestring() execfile() issubclass() print() super()
51-
bin() file() iter() property() tuple()
52-
bool() filter() len() range() type()
53-
bytearray() float() list() raw_input() unichr()
54-
callable() format() locals() reduce() unicode()
55-
chr() frozenset() long() reload() vars()
56-
classmethod() getattr() map() repr() xrange()
57-
cmp() globals() max() reversed() zip()
58-
compile() hasattr() memoryview() round() __import__()
59-
complex() hash() min() set()
60-
delattr() help() next() setattr()
61-
dict() hex() object() slice()
62-
dir() id() oct() sorted()
112+
# Builtin functions: Python 2
63113

64114
apply()
115+
basestring()
65116
buffer()
117+
cmp()
66118
coerce()
119+
execfile()
120+
file()
67121
intern()
122+
long()
123+
raw_input()
124+
reduce()
125+
reload()
126+
unichr()
127+
unicode()
128+
xrange()
129+
130+
print()
68131

69132
# Builtin functions: Python 3
70133

71-
abs() dict() help() min() setattr()
72-
all() dir() hex() next() slice()
73-
any() divmod() id() object() sorted()
74-
ascii() enumerate() input() oct() staticmethod()
75-
bin() eval() int() open() str()
76-
bool() exec() isinstance() ord() sum()
77-
bytearray() filter() issubclass() pow() super()
78-
bytes() float() iter() print() tuple()
79-
callable() format() len() property() type()
80-
chr() frozenset() list() range() vars()
81-
classmethod() getattr() locals() repr() zip()
82-
compile() globals() map() reversed() __import__()
83-
complex() hasattr() max() round()
84-
delattr() hash() memoryview() set()
134+
ascii()
135+
bytes()
136+
exec()
137+
print()
85138

86139
# Builtin exceptions and warnings.
87140

0 commit comments

Comments
 (0)