Advertisement
python_notes

python programming reserved words

Aug 11th, 2014
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. The following identifiers are used as reserved words, or keywords of the language, and cannot be used as ordinary identifiers. They must be spelled exactly as written here:
  2.  
  3.  
  4. and del from not while
  5. as elif global or with
  6. assert else if pass yield
  7. break except import print
  8. class exec in raise
  9. continue finally is return
  10. def for lambda try
  11.  
  12.  
  13.  
  14. Changed in version 2.4: None became a constant and is now recognized by the compiler as a name for the built-in object None. Although it is not a keyword, you cannot assign a different object to it.
  15.  
  16. Changed in version 2.5: Both as and with are only recognized when the with_statement future feature has been enabled. It will always be enabled in Python 2.6. See section 7.5 for details. Note that using as and with as identifiers will always issue a warning, even when the with_statement future directive is not in effect.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement