GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in classes by serhiy-storchaka · Pull Request #123613 · python/cpython Conversation
|
|
Serhiy, it's seems that you forgot to commit the actual fix(and tests) and accidentally added two |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…lineno__ in classes * 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 the latters. 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.
fa4c94a to
f2a8b90
Compare
|
Thanks for noticing this @Eclips4! I somewhere accidentally used Two NEWS entries are intentional, as they belong to different sections (Core and Library). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
|
||
| :attr:`__firstlineno__` | ||
| The line number of the first line of the class definition, including decorators. | ||
| Setting :attr:`__module__` removes :attr:`__firstlineno__`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| Setting :attr:`__module__` removes :attr:`__firstlineno__`. | |
| Setting :attr:`!__module__` removes :attr:`!__firstlineno__`. |
Note that the link to __module__ does not exist (we don't have a global .. attribute:: __module__). We can address this issue in a follow-up PR, but for now, let's just suppress the link.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Well, the link to __firstlineno__ should be suppressed, but the link to __module__ may work in future.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
|
||
| :attr:`__firstlineno__` | ||
| The line number of the first line of the class definition, including decorators. | ||
| Setting :attr:`__module__` removes :attr:`__firstlineno__`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Well, the link to __firstlineno__ should be suppressed, but the link to __module__ may work in future.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…__firstlineno__ in classes (pythonGH-123613) * 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 69a4063) Co-authored-by: Serhiy Storchaka <[email protected]>
|
GH-124735 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…tlineno__ 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 69a4063)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.