◐ Shell
reader mode source ↗
Skip to content

bpo-38307: Add end_lineno attribute to pyclbr _Objects#24348

Merged
terryjreedy merged 35 commits into
python:masterfrom
kebab-mai-haddi:endline-in-readmodule-module
Feb 1, 2021
Merged

bpo-38307: Add end_lineno attribute to pyclbr _Objects#24348
terryjreedy merged 35 commits into
python:masterfrom
kebab-mai-haddi:endline-in-readmodule-module

Conversation

@kebab-mai-haddi

@kebab-mai-haddi kebab-mai-haddi commented Jan 27, 2021

Copy link
Copy Markdown
Contributor

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

Aviral Srivastava and others added 23 commits September 28, 2019 13:21
…va254084/cpython into endline-in-readmodule-module
@kebab-mai-haddi kebab-mai-haddi changed the title Endline in readmodule module Jan 27, 2021
13 hidden items Load more…

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide 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.

@terryjreedy

terryjreedy commented Jan 27, 2021

Copy link
Copy Markdown
Member

Tests/macOS just says 'Error'. I suspect that this is not related to patch.
Travis and Pipelines failures are due to bad markup in the blurb.

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.

@terryjreedy

Copy link
Copy Markdown
Member

Since retests had the same 'default role used' complaint, I removed all markup.

@kebab-mai-haddi

Copy link
Copy Markdown
Contributor Author

Since retests had the same 'default role used' complaint, I removed all markup.

Thanks, @terryjreedy . All tests passed, does this mean the PR will be merged as per the standards?

@merwok

merwok commented Jan 28, 2021

Copy link
Copy Markdown
Member

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.

@kebab-mai-haddi

Copy link
Copy Markdown
Contributor Author

@terryjreedy , so should I modify the PR with end_lineno=None?

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide 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.)

@terryjreedy

Copy link
Copy Markdown
Member

I am making the changes now.

@terryjreedy terryjreedy changed the title bpo-38307: Endline in readmodule of pyclbr Feb 1, 2021
@terryjreedy terryjreedy changed the title bpo-38307: Add endline to pyclbr Objects Feb 1, 2021
@terryjreedy terryjreedy added the type-feature A feature request or enhancement label Feb 1, 2021
@terryjreedy terryjreedy merged commit 000cde5 into python:master Feb 1, 2021
@kebab-mai-haddi

Copy link
Copy Markdown
Contributor Author

Thank you @terryjreedy !

Does this mean that new installations of Python will have this change or should one wait for the tag release?
I know making from source will have the change but wasn't sure about which version of Python would have this change. Can you help me understand that?

Thanks again!

@merwok

merwok commented Feb 1, 2021

Copy link
Copy Markdown
Member

As a new feature, this will be released in Python 3.10.

@terryjreedy

Copy link
Copy Markdown
Member

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.

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants