cpython
cpython copied to clipboard
The Python programming language
# Bug report The following code does not work: ```python class SlotNonDataclass: __slots__ = ("foo",) def __init__(self, foo: str): # To support frozen derived classes. object.__setattr__(self, "foo", foo) @dataclass(frozen=True) class...
In https://github.com/python/cpython/pull/118450, Sam pointed out that GC can occur at any `Py_DECREF`. With deferred references, we will need to traverse the object's stacks. The main problem is that `frame->stacktop` might...
Speed up `glob.glob()` and `glob.iglob()` by reducing the number of system calls made. This unifies the implementations of globbing in the `glob` and `pathlib` modules. ## Depends on - #117589...
`drop_gil()` assumes that its caller is attached, which means that the current thread holds the GIL if and only if the GIL is enabled, and the enabled-state of the GIL...
The function name has an underscore. Without this, calling help can cause an exception. Should be reproducible by calling `help()` in the repl on windows. I personally found it by...
# Bug report In https://github.com/python/cpython/pull/114574 we switched a number of non-PyObject allocations from `PyObject_Malloc` to `PyMem_Malloc`, including `tp_doc` on `PyHeapTypeObject`s. Unfortunately, this isn't backwards compatible because C-API extensions may allocate...
This exposes `_PyWeakref_ClearWeakRefsExceptCallbacks` as an unstable C-API function to provide a thread-safe mechanism for clearing weakrefs without executing callbacks. Some C-API extensions need to clear weakrefs without calling callbacks, such...
Remove support for supplying keyword arguments to `pathlib.Path()`. This has been deprecated since Python 3.12. * Issue: gh-74033 ---- 📚 Documentation preview 📚: https://cpython-previews--118793.org.readthedocs.build/
@AlexWaygood * Issue: gh-90190 ---- 📚 Documentation preview 📚: https://cpython-previews--116544.org.readthedocs.build/
# Feature or enhancement ### Proposal: Based on [PEP 564](https://peps.python.org/pep-0564/), the `time` module has `_ns()` methods that generate timestamps of nanoseconds since the epoch. I think it might make sense...