A Scope. A scope is the lexical extent over which all identifiers with the same name refer to the same variable. Modules, Classes and Functions are all Scopes. There are no other scopes. The scopes for expressions that create new scopes, lambdas and comprehensions, are handled by creating an anonymous Function.
Whether this contains
Gets an exit from this Scope’s control flow graph, that does not result from an exception
Gets a top-level statement in this scope
Gets an exit from this Scope’s control flow graph
Gets the statements forming the body of this scope
Gets the docstring for this scope
Gets the scope enclosing this scope (modules have no enclosing scope)
Gets the entry point into this Scope’s control flow graph
Gets the evaluation scope for code in this (lexical) scope. This is usually the scope itself, but may be an enclosing scope. Notably, for list comprehensions in Python 2.
Gets the non-explicit exit from this Scope’s control flow graph
Gets the name of this scope
Gets the exit of this scope following from a return statement
Gets the scope enclosing this scope (modules have no enclosing scope).
Gets the nth statement of this scope
Holds if this scope is in the source archive, that is it is part of the code specified, not library code
Holds if this scope is deemed to be public
Holds if this a top-level (non-nested) class or function
Holds if this scope can be expected to execute before