bpo-38307: Add end_lineno attribute to pyclbr _Objects#24348
Conversation
…nstead to the stack
…va254084/cpython into endline-in-readmodule-module
…in the nest functions
…addi/cpython into endline-in-readmodule-module
terryjreedy
left a comment
There was a problem hiding this comment.
Thank you for the revised patch. On the issue, I questioned whether we can insert end_lineno within the existing signatures. I have posted to pydev for additional opinions. The patch otherwise looks fine except for the blurb, which I would revise before merging.
Sorry, something went wrong.
|
Tests/macOS just says 'Error'. I suspect that this is not related to patch. The revised blurb should pass. It may still be too wordy. The person merging this should likely add a What's New entry. The details will depend on where the new argument is added. This is worth an addition to Misc/Acks. This should not be done until just before merging, or after. |
Sorry, something went wrong.
|
Since retests had the same 'default role used' complaint, I removed all markup. |
Sorry, something went wrong.
Thanks, @terryjreedy . All tests passed, does this mean the PR will be merged as per the standards? |
Sorry, something went wrong.
|
There is a discussion about this change : it breaks compatibility but for something that was not supposed to be used directly — more changes are suggested to break with a clear message rather than appear to work. |
Sorry, something went wrong.
|
@terryjreedy , so should I modify the PR with |
Sorry, something went wrong.
terryjreedy
left a comment
There was a problem hiding this comment.
Before merging, an entry for pyclbr should be added to Improved Modules in Doc/whatsnew/3.10.rst. I think the following is enough.
Add an 'end_lineno' attribute to the Class and Function objects that appear in the
tree returned by pyclbr functions. (Contributed by Aviral Srivastava in bpo-38307.)
(With bpo marked-up as for other entries.)
Sorry, something went wrong.
|
I am making the changes now. |
Sorry, something went wrong.
Co-authored-by: Éric Araujo <merwok@netwok.org>
|
Thank you @terryjreedy ! Does this mean that new installations of Python will have this change or should one wait for the tag release? Thanks again! |
Sorry, something went wrong.
|
As a new feature, this will be released in Python 3.10. |
Sorry, something went wrong.
|
I don't know what you mean by a tag release, but 3.10.0a5, with Windows and macOS installers should be coming soon and will include this. 3.10.0 should be out next September. |
Sorry, something went wrong.
For back-compatibility, make the new constructor parameter for public classes Function and Class keyword-only with a default of None. Co-authored-by: Aviral Srivastava <aviralsrivastava@Avirals-MacBook-Air.local Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
For back-compatibility, make the new constructor parameter for public classes Function and Class
keyword-only with a default of None.
bpo-38307: Provide class' and function's end line in order to provide the scope of the classes and functions in a module.
https://bugs.python.org/issue38307