Skip to content

Commit

Permalink
Be explicit about builtin functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nfnty committed Mar 4, 2017
1 parent 95fcb49 commit e036a4c
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 32 deletions.
2 changes: 1 addition & 1 deletion syntax/python.vim
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ endif
"

if s:Enabled('g:python_highlight_builtin_funcs')
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'
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'

if s:Python2Syntax()
let s:funcs_re .= '|apply|basestring|buffer|cmp|coerce|execfile|file|intern|long|raw_input|reduce|reload|unichr|unicode|xrange'
Expand Down
115 changes: 84 additions & 31 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,46 +42,99 @@ async def Test

bool bytearray dict float frozenset int list object set str tuple

# Builtin functions: Python 2
# Builtin functions

__import__()
abs()
all()
any()
bin()
bool()
bytearray()
callable()
chr()
classmethod()
compile()
complex()
delattr()
dict()
dir()
divmod()
enumerate()
eval()
filter()
float()
format()
frozenset()
getattr()
globals()
hasattr()
hash()
help()
hex()
id()
input()
int()
isinstance()
issubclass()
iter()
len()
list()
locals()
map()
max()
memoryview()
min()
next()
object()
oct()
open()
ord()
pow()
property()
range()
repr()
reversed()
round()
set()
setattr()
slice()
sorted()
staticmethod()
str()
sum()
super()
tuple()
type()
vars()
zip()

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

apply()
basestring()
buffer()
cmp()
coerce()
execfile()
file()
intern()
long()
raw_input()
reduce()
reload()
unichr()
unicode()
xrange()

print()

# Builtin functions: Python 3

abs() dict() help() min() setattr()
all() dir() hex() next() slice()
any() divmod() id() object() sorted()
ascii() enumerate() input() oct() staticmethod()
bin() eval() int() open() str()
bool() exec() isinstance() ord() sum()
bytearray() filter() issubclass() pow() super()
bytes() float() iter() print() tuple()
callable() format() len() property() type()
chr() frozenset() list() range() vars()
classmethod() getattr() locals() repr() zip()
compile() globals() map() reversed() __import__()
complex() hasattr() max() round()
delattr() hash() memoryview() set()
ascii()
bytes()
exec()
print()

# Builtin exceptions and warnings.

Expand Down

0 comments on commit e036a4c

Please sign in to comment.