Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

@kebab-mai-haddi
Copy link
Contributor

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

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 Sep 28, 2019
…nstead to the stack
Aviral Srivastava Aviral Srivastava
…va254084/cpython into endline-in-readmodule-module
wip
@kebab-mai-haddi kebab-mai-haddi changed the title Endline in readmodule module bpo-38307: Endline in readmodule of pyclbr Jan 27, 2021
@kebab-mai-haddi kebab-mai-haddi requested a review from terryjreedy as a code owner Jan 27, 2021
Copy link
Member

@terryjreedy terryjreedy left a 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.

@@ -0,0 +1,4 @@
Adds end line no in class' use: generating dependency.

This comment has been minimized.

@merwok

merwok Jan 27, 2021
Member

I can’t parse this line 🙂
(and second line starting with colon seems strange)

This comment has been minimized.

@terryjreedy

terryjreedy Jan 27, 2021
Member

Neither could I nor the doc tests. I replaced it.

This comment has been minimized.

@kebab-mai-haddi

kebab-mai-haddi Jan 27, 2021
Author Contributor

Thanks, @terryjreedy !
But how could you push a change to my forked repository?

(I am not objecting to it, I just do not understand how another person can push to mine repo)

This comment has been minimized.

@terryjreedy

terryjreedy Jan 27, 2021
Member

When you made the PR, you left a checkmark in the box that says to allow core developers ('Members of Python' when you mouse over the icons) to modify the files in this branch. If you had removed it, I would have asked to put is back in if possible. To pull to your local repository, which you should do before making further changes, checkout this branch, endline-in-readmodule-module, and, I believe, if you defined 'origin' as the devguide suggests

git pull origin endline-in-readmodule-module

Don't use rebase.

@terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Jan 27, 2021

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
Member

@terryjreedy terryjreedy commented Jan 27, 2021

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

@kebab-mai-haddi
Copy link
Contributor Author

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

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
Copy link
Member

@merwok merwok commented Jan 28, 2021

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
Contributor Author

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

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

Copy link
Member

@terryjreedy terryjreedy left a 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.)

Lib/pyclbr.py Show resolved Hide resolved
Lib/pyclbr.py Show resolved Hide resolved
Lib/pyclbr.py Outdated Show resolved Hide resolved
Lib/pyclbr.py Outdated Show resolved Hide resolved
@terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Feb 1, 2021

I am making the changes now.

terryjreedy and others added 4 commits Feb 1, 2021
Co-authored-by: Éric Araujo <merwok@netwok.org>
@terryjreedy terryjreedy changed the title bpo-38307: Endline in readmodule of pyclbr bpo-38307: Add endline to pyclbr Objects Feb 1, 2021
@terryjreedy terryjreedy changed the title bpo-38307: Add endline to pyclbr Objects bpo-38307: Add end_lineno attribute to pyclbr _Objects Feb 1, 2021
@terryjreedy terryjreedy merged commit 000cde5 into python:master Feb 1, 2021
11 checks passed
11 checks passed
Docs
Details
Check for source changes
Details
Check if generated files are up to date
Details
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20210201.11 succeeded
Details
Travis CI - Pull Request Build Passed
Details
bedevere/issue-number Issue number 38307 found
Details
bedevere/news News entry found in Misc/NEWS.d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants