Notice: While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience.
Version: None
Released: Sept. 6, 2024
This is a security release of Python 3.9 Note: The release you're looking at is Python 3.9.20, a security bugfix release for the legacy 3.9 series. Python 3.12 is now the latest feature release series of Python 3. Get the latest release of 3.12.x here. Security content in this …
View Release Notes
This is a security release of Python 3.8 Note: The release you're looking at is Python 3.8.20, a security bugfix release for the legacy 3.8 series. Python 3.12 is now the latest feature release series of Python 3. Get the latest release of 3.12.x here. Security content in this …
Released: Sept. 7, 2024
This is a security release of Python 3.10 Note: The release you're looking at is Python 3.10.15, a security bugfix release for the legacy 3.10 series. Python 3.12 is now the latest feature release series of Python 3. Get the latest release of 3.12.x here. Security content in this …
This is a security release of Python 3.11 Note: The release you're looking at is Python 3.11.10, a security bugfix release for the legacy 3.11 series. Python 3.12 is now the latest feature release series of Python 3. Get the latest release of 3.12.x here. Security content in this …
This is the sixth maintenance release of Python 3.12 Python 3.12 is the newest major release of the Python programming language, and it contains many new features and optimizations. 3.12.6 is the latest maintenance release, containing about 90 bugfixes, build improvements and documentation changes since 3.12.5. This is an expedited …
...getattribute__, bear in mind that it is easy to cause infinite recursion: whenever __getattribute__ references an attribute of self (even self.__dict__!), it is called recursively. (This is similar to __setattr__, which gets called for all attribute assignments; __getattr__ can also suffer from this when it is carelessly written and references a non-existent attribute of self.) The correct way to get any attribute from self inside __getattribute__ is to call the base class's __getattrib...
...GetAttr() and PyObject_SetAttr() now accept Unicode objects for the attribute name. See note on getattr() above. A few bug fixes to argument processing for Unicode. PyArg_ParseTupleAndKeywords() now accepts "es#" and "es". PyArg_Parse() special cases "s#" for Unicode objects; it returns a pointer to the default encoded string data instead of to the raw UTF-16. Py_BuildValue accepts B format (for bgen-generated code). Internals On Unix, fix code for finding ...
...getattr() operation with AttributeError exceptions changed into ImportError. "from M import *" now looks for M.__all__ to decide which names to import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but filters out names starting with '_' as before. Whether or not __all__ exists, there's no restriction on the type of M. File objects have a new method, xreadlines(). This is the fastest way to iterate over all lines in a file: for line in file.xreadlines(): ...do something to...
...getattr__ is now called __getattribute__. This method, if defined, is called for every attribute access. A new __getattr__ hook more similar to the one in classic classes is defined which is called only if regular attribute access raises AttributeError; to catch all attribute access, you can use __getattribute__ (for new-style classes). If both are defined, __getattribute__ is called first, and if it raises AttributeError, __getattr__ is called. The __class__ attribute of new-style objects ca...
...getattr hooks. If an old-style instance didn't have a __del__ method, but did have a __getattr__ hook, and the instance became reachable only from an unreachable cycle, and the hook resurrected or deleted unreachable objects when asked to resolve "__del__", anything up to a segfault could happen. That's been repaired. dict.pop now takes an optional argument specifying a default value to return if the key is not in the dict. If a default is not given and the key is not found, a KeyEr...
If you didn't find what you need, try your search in the Python language documentation.