4. Execution model — Python 3.14.7 documentation

docs.python.org

Tin mới

5. The import system

Python Module Index

3.14.7 Documentation

The Python Language Reference

4.1. Structure of a program¶

A code block is executed in an execution frame. A frame contains some administrative information (used for debugging) and determines where and how execution continues after the code block’s execution has completed.

4.1. Structure of a program¶

A code block is executed in an execution frame. A frame contains some administrative information (used for debugging) and determines where and how execution continues after the code block’s execution has completed.

type parameter lists

4.2.1. Binding of names¶

Names refer to objects. Names are introduced by name binding operations.

4.2.1. Binding of names¶

Names refer to objects. Names are introduced by name binding operations.

4.2.2. Resolution of names¶

A scope defines the visibility of a name within a block. If a local variable is defined in a block, its scope includes that block. If the definition occurs in a function block, the scope extends to any blocks contained w

the FAQ entry on UnboundLocalError

A scope defines the visibility of a name within a block. If a local variable is defined in a block, its scope includes that block. If the definition occurs in a function block, the scope extends to any blocks contained w

builtins: The module that provides the built-in namespace.

A scope defines the visibility of a name within a block. If a local variable is defined in a block, its scope includes that block. If the definition occurs in a function block, the scope extends to any blocks contained w

__main__: The environment where top-level code is run. Covers command-line interfaces, import-time behavior, and ``__name__ == '__main__'``.

A scope defines the visibility of a name within a block. If a local variable is defined in a block, its scope includes that block. If the definition occurs in a function block, the scope extends to any blocks contained w

definition.__qualname__

While annotation scopes have an internal name, that name is not reflected in the qualified name of objects defined within the scope. Instead, the __qualname__ of such objects is as if the object were defined in the enclo

threading: Thread-based parallelism.

A Python implementation won’t necessarily implement the runtime layers distinctly or even concretely. The only exception is places where distinct layers are directly specified or exposed to users, like through the thread

4.4.2. Python Runtime Model¶

The same conceptual layers apply to each Python program, with some extra data layers specific to Python:

os: Miscellaneous operating system interfaces.

The same conceptual layers apply to each Python program, with some extra data layers specific to Python:

subprocess: Subprocess management.

The same conceptual layers apply to each Python program, with some extra data layers specific to Python:

multiprocessing: Process-based parallelism.

The same conceptual layers apply to each Python program, with some extra data layers specific to Python:

concurrent.interpreters: Multiple interpreters in the same process

The same conceptual layers apply to each Python program, with some extra data layers specific to Python:

asyncio: Asynchronous I/O.

The same conceptual layers apply to each Python program, with some extra data layers specific to Python: