Notice: This page displays a fallback because interactive scripts did not run. Possible causes include disabled JavaScript or failure to load scripts or stylesheets.
Version: None
Released: Sept. 6, 2022
This is the seventh maintenance release of Python 3.10 Python 3.10.7 is the newest major release of the Python programming language, and it contains many new features and optimizations. Major new features of the 3.10 series, compared to 3.9 Among the new major new features and …
View Release Notes
...variable. It uses a funny name because the user's instance variables (e.g. self.a later in the example) live in the same namespace. The __getattr__ method is invoked whenever the user code references an attribute of the instance that is not an instance variable (nor a class variable; but except for __init__ and __getattr__ there are no class variables). It will be called, for example, when aninstance.method1 is referenced in the example, with self set to aninstance and name set to th...
...variables and modules are "cleared carefully" in a partially specified order. The operation "clear carefully" is defined below; it effectively deletes the module's variables in a partially specified order. M1. Before anything else, the following variables are set to None (not necessarily in this order): __builtin__._ sys.exc_{type,value,traceback} sys.last_{type,value,traceback} sys.path sys.argv sys.ps1, sys.ps2 sys.exitfunc [path, argv, ps1, ps2 and exitfunc ...
...variable, it seems a waste of time to consider them much for this comparison. Java Python programs are generally expected to run slower than Java programs, but they also take much less time to develop. Python programs are typically 3-5 times shorter than equivalent Java programs. This difference can be attributed to Python's built-in high-level data types and its dynamic typing. For example, a Python programmer wastes no time declaring the types of arguments or variables, and Python...
Organizations Cooperating with the Python Software Foundation The Python Software Foundation cooperates with the following organizations, who share the PSF's interest in Python and free software: ZEUUX Python African Tour
...variable (which gives the full name of the module or package). The __path__ Variable The one distinction between packages and modules lies in the presence or absence of the variable __path__. This is only present for packages. It is initialized to a list of one item, containing the directory name of the package (a subdirectory of a directory on sys.path). Changing __path__ changes the list of directories that are searched for submodules of the package. For example, the Sound.Eff...
...variable will raise AttributeError as expected. (Note that in Python 2.2b2 and earlier, slot variables had the value None by default, and "deleting" them restores this default value.) You cannot use a class attribute to define a default value for an instance variable defined by __slots__; the __slots__ declaration creates a class attribute for each variable containing a descriptor, and setting a class attribute to a default value would overwrite this descriptor. There's no check th...
...variable lookups are much faster than global or built-in variable lookups: the Python "compiler" optimizes most function bodies so that for local variables, no dictionary lookup is necessary, but a simple array indexing operation is sufficient. The relative speed of f4() compared to f1() and f3() suggests that both reasons why f3() is faster contribute, but that the first reason (fewer lookups) is a bit more important. (To get more precise data on this, we would have to instrumen...
...variables and no __dict__ by using __slots__ = []. You cannot use slots with "variable-length" built-in types as base class. Variable-length built-in types are long, str and tuple. A class using __slots__ does not support weak references to its instances, unless one of the strings in the __slots__ list equals "__weakref__". (Hmm, this feature could be extended to "__dict__"...) The __slots__ variable doesn't have to be a list; any non-string that can be iterated over will do, an...
...variables and no __dict__ by using __slots__ = []. You cannot use slots with "variable-length" built-in types as base class. Variable-length built-in types are long, str and tuple. A class using __slots__ does not support weak references to its instances, unless one of the strings in the __slots__ list equals "__weakref__". (In Python 2.3, this feature has been extended to "__dict__") The __slots__ variable doesn't have to be a list; any non-string that can be iterated over wil...
...variables in the outer scope, which makes it impossible to determine the bindings for free variables in the inner scope. To avoid the warning about import *, change it into an import of explicitly name object, or move the import* statement to the global scope; to avoid the warning about bare exec, use exec...in... (a good idea anyway -- there's a possibility that bare exec will be deprecated in the future). Use of a global variable in a nested scope with the same name as a local variable in a s...
...variables, evaluation of arbitrary expressions, setting breakpoints, stepping through the code a line at a time, and so on. The debugger is written in Python itself, testifying to Python's introspective power. On the other hand, often the quickest way to debug a program is to add a few print statements to the source: the fast edit-test-debug cycle makes this simple approach very effective. See also some comparisons between Python and other languages.
...VARIABLE TYPE="PyObject*" NAME="right"></VARIABLE> <VARIABLE TYPE="PyObject*" NAME="left"></VARIABLE> <VARIABLE TYPE="PyObject*" NAME="expr"></VARIABLE> <CODE_SNIPPET> right = stack_pop(); left = stack_pop(); expr = PyObject_CallMethod(ParsedExpr, "ParsedUnionExpr", "OO", left, right); decref(right); decref(left); stack_push(expr); </CODE_SNIPPET> ...
Released: Oct. 5, 2020
This is an early developer preview of Python 3.10 Major new features of the 3.10 series, compared to 3.9 Python 3.10 is still in development. This releasee, 3.10.0a1 is the first of six planned alpha releases. Alpha releases are intended to make it easier to test the current …
Released: Feb. 26, 2020
This is an early developer preview of Python 3.9 Python 3.9 is still in development. This release, 3.9.0a4 is the fourth of six planned alpha releases. Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the …
Released: March 23, 2020
This is an early developer preview of Python 3.9 Python 3.9 is still in development. This release, 3.9.0a5 is the fifth of six planned alpha releases. Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the …
Released: Nov. 3, 2020
This is an early developer preview of Python 3.10 Major new features of the 3.10 series, compared to 3.9 Python 3.10 is still in development. This releasee, 3.10.0a2 is the second of six planned alpha releases. Alpha releases are intended to make it easier to test the current …
Released: Dec. 7, 2020
This is an early developer preview of Python 3.10 Major new features of the 3.10 series, compared to 3.9 Python 3.10 is still in development. This releasee, 3.10.0a3 is the second of six planned alpha releases. Alpha releases are intended to make it easier to test the current …
Released: Jan. 4, 2021
This is an early developer preview of Python 3.10 Major new features of the 3.10 series, compared to 3.9 Python 3.10 is still in development. This release, 3.10.0a4 is the fourth of six planned alpha releases. Alpha releases are intended to make it easier to test the current …
If you didn't find what you need, try your search in the Python language documentation.