Skip to content

Keywords

Reserved Keywords

The following identifiers are reserved and cannot be used as names (e.g., variable names, function names, etc)1.

Identifier Identifier Identifier Identifier Identifier
False None True and as
assert async await break class
continue def del elif else
except finally for from global
if import in is lambda
nonlocal not or pass raise
return try while with yield

Notice how all of them have special color instead of the usual black color. This is how you can usually determine if an identifier is reserved or not.

Built-In Keywords

The following identifiers are part of built-in functions2. They should not be used but there will be no warning from Python.

Identifier Identifier Identifier Identifier Identifier Identifier Identifier
abs aiter all anext any ascii bin
bool breakpoint bytearray bytes callable chr classmethod
compile complex delattr dict dir divmod enumerate
eval exec 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 print property range repr
reversed round set setattr slice sorted staticmethod
str sum super tuple type vars zip

Many of these also have special colors. So try to avoid identifiers that have special colors.