Python Forum

Full Version: i can use this statement as a variable name
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
there is such a thing as an async statement. yet i can use async as a variable name. it is not a reserved word. how does that work?
it will only work until you try to use the real async in the same scope
Currently, it appears there are only 35 words you can't use as variable names. But, as Larz points out, that doesn't mean it's necessarily a good idea to use all the other words as variable names.
is there a list of all the other words that is a good idea to avoid?
All the built-ins and all the standard modules?
just those and no more? can i use async?
Just an FYI, a good IDE, such as VSCode will highlight 'reserved words' (old school).
It doesn't prevent you from using them, but makes you aware of the danger involved.