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: Oct. 15, 2024
This is an early developer preview of Python 3.14 Major new features of the 3.14 series, compared to 3.13 Python 3.14 is still in development. This release, 3.14.0a1 is the first of seven planned alpha releases. Alpha releases are intended to make it easier to test the current state of …
View Release Notes
...immutable type. If instead of __new__ we had tried to override __init__, it wouldn't have worked: >>> class inch(float): ... "THIS DOESN'T WORK!!!" ... def __init__(self, arg=0.0): ... float.__init__(self, arg*0.0254) ... >>> print inch(12) 12.0 >>> The version overriding __init__ doesn't work because the float type's __init__ is a no-op: it returns immediately, ignoring its arguments. All this is done so that immutable ...
...immutable type. If instead of __new__ we had tried to override __init__, it wouldn't have worked: >>> class inch(float): ... "THIS DOESN'T WORK!!!" ... def __init__(self, arg=0.0): ... float.__init__(self, arg*0.0254) ... >>> print inch(12) 12.0 >>> The version overriding __init__ doesn't work because the float type's __init__ is a no-op: it returns immediately, ignoring its arguments. All this is done so that immutable types can preserve their immuta...
...immutable; this is why you need PyTuple_SetItem().) 2) What the heck is going on with printing? Am I somehow saving the object from ignoble destruction by calling repr on it just before I need it? Could this be a problem with refcounting objects inserted in the dictionary (doesn't seem likely given that PyDict_SetItem is said to store it's own references to objects). As I said, it's not the printing, it's the repr() call. I don't expect repr() to save a reference to your obje...
...immutable bytes. Issue #3797: Fixed the dbm, marshal, mmap, ossaudiodev, & winreg modules to return bytes objects instead of bytearray objects. Tools/Demos Fix Misc/gdbinit so it works. Build Issue #3812: Failed to build python if configure --without-threads. Issue #3791: Remove the bsddb module from the Windows installer, and the core bsddb library from the Windows build files. What's new in Python 3.0b3? Release date: 20-Aug-2008 Core and Builtins Issue #3653: Fix a segfault ...
...immutable built-in types: you can only affect the value of the instance by overloading __new__. You can add mutable attributes, and the subclass instances will have a __dict__ attribute, but you cannot change the "value" (as implemented by the base class) of an immutable subclass instance once it is created. The dictionary constructor now takes an optional argument, a mapping-like object, and initializes the dictionary from its (key, value) pairs. A new built-in type, super, has bee...
If you didn't find what you need, try your search in the Python language documentation.