cpython
cpython copied to clipboard
The Python programming language
While working on https://github.com/python/cpython/pull/97958 I've noticed that there's something strange with `help()` and `classmethod`s. Take a look at this example: ```python import pydoc class My: @classmethod def __init_subclass__(cls, *args, **kwargs):...
``` def f(x): match x: case a,b: return 1 import dis from pprint import pprint as pp def pos(p): return (p.lineno, p.end_lineno, p.col_offset, p.end_col_offset) pp([(pos(x.positions), x.opname, x.argval) for x in...
This PR removes the recursive updates which made the locations incorrect. They are still too broad in some cases, but we should deal with the separately. (One thing we would...
After #99160, the `SyntaxError` points to the `try` keyword, but I think it would be relatively easy to make it point to the `except` or `except*` (whichever one is responsible...
This PR improves the coverage of the function `PyObject_Print`: https://github.com/python/cpython/blob/29b391b1378577825a658b14764a8ff3e0b5c958/Objects/object.c#L256 The coverage achieved is the following:  I couldn't hit line 294, I'm open for discussion on how to do...
Fix issue where json.dumps provided a different error message than json.dump with non-finite values * Issue: gh-86018
The following test program gains about 10M per second under top, on Python 3.11 only (confirmed for all development stages: 3.11.0a4, 3.11.0b1, 3.11.0rc1, 3.11.0) . 3.10 shows no memory growth....
BPO | [43236](https://bugs.python.org/issue43236) --- | :--- Nosy | @terryjreedy, @pfmoore, @tjguk, @ned-deily, @zware, @eryksun, @zooba, @veganaiZe Files | [jumplist.png](https://bugs.python.org/file49812/jumplist.png "Uploaded as image/png at 2021-02-16.01:53:23 by @veganaiZe"): PNG image of jump...
Move setting up inheritance registry from `ABCMeta.__new__` to `ABCMeta.__init__`. This makes the `__module__` attribute be properly set for types created by calling `ABCMeta()`. https://bugs.python.org/issue28869
Now that the `_closed` attribute has been removed we can move ahead with this. https://bugs.python.org/issue39783