]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in...
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 30 Sep 2024 04:21:40 +0000 (07:21 +0300)
committerGitHub <noreply@github.com>
Mon, 30 Sep 2024 04:21:40 +0000 (21:21 -0700)
commit5bf32d1300f7342ec76e8afee480eef07d00a23b
treea323bdf62b061e991c710e5a087bebee173e8e9a
parentce0eaa67032389d64fd2d7fb510e34372082eef8
[3.13] gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in classes (GH-123613) (#124735)

* Setting the __module__ attribute for a class now removes the
  __firstlineno__ item from the type's dict.
* The _collections_abc and _pydecimal modules now completely replace the
  collections.abc and decimal modules after importing them. This
  allows to get the source of classes and functions defined in these
  modules.
* inspect.findsource() now checks whether the first line number for a
  class is out of bound.
(cherry picked from commit 69a4063ca516360b5eb96f5432ad9f9dfc32a72e)
Doc/reference/datamodel.rst
Lib/collections/abc.py
Lib/decimal.py
Lib/inspect.py
Lib/test/test_builtin.py
Lib/test/test_decimal.py
Lib/test/test_inspect/inspect_fodder2.py
Lib/test/test_inspect/test_inspect.py
Misc/NEWS.d/next/Core_and_Builtins/2024-09-02-20-36-45.gh-issue-123339.QcmpSs.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2024-09-02-20-34-04.gh-issue-123339.czgcSu.rst [new file with mode: 0644]
Objects/typeobject.c