Colin Keenan
Colin Keenan

Reputation: 1149

Where to find an official list of how each python keyword is implemented?

I'm learning python 2.7 and picking up the use of basic keywords from random bits of code or by searching questions here on stackoverflow. I know about the official python documentation, and found a list of keywords in it: 2.3.1. Keywords. I also found similar information in wikipedia. Those are just lists of words without any explanation of how to use them.

I'm looking for a clickable list so that by clicking on is for example, it would take me to a description of how is is implemented. Is such a page in the official python documentation or anywhere on the internet?

Upvotes: 2

Views: 138

Answers (2)

Blckknght
Blckknght

Reputation: 104722

I suspect the list of keyword uses doesn't exist because different keywords are used in very different ways.

Here's a quick breakdown of the keywords from Python 2.7:

  • Operators and other Expressions:
    • and
    • is
    • lambda
    • not
    • or
    • yield
  • Simple Statements
    • assert
    • break
    • continue
    • del
    • exec
    • from
    • global
    • import
    • pass
    • print
    • raise
    • return
  • Compound Statements
    • class
    • def
    • elif
    • except
    • finally
    • try
    • while
    • with
  • Misc
    • as (only used as part of from, import and with statements, never on its own)
  • Multiple kinds of uses:
    • else (can be part of an expression or a compound statement)
    • for (can be part of an expression or a compound statement)
    • if (can be part of an expression or a compound statement)
    • in (can be a binary operator, or paired with for in an expression or statement)

Upvotes: 1

Pedro Romano
Pedro Romano

Reputation: 11203

The Python 2.7 Quick Reference is probably in the vein of what you are looking for.

There's also the official The Python Language Reference.

David Beazley's Python Essential Reference, 4th Edition book is probably the closest to what you are looking for, but only exists in book format (there's an ebook version).

Upvotes: 0

Related Questions