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-26120: make pydoc exclude __future__ imports from the data block of the module #30888

Merged
merged 4 commits into from Mar 28, 2022

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Jan 25, 2022

@iritkatriel iritkatriel changed the title bpo-26120: make pydoc exclude __future__ imports from the data block … bpo-26120: make pydoc exclude __future__ imports from the data block of the module Jan 25, 2022
@arhadthedev
Copy link
Member

Python 2.7 reached end-of-life January 1, 2020. Do we really need to carry __future__ around in pydoc?

@iritkatriel
Copy link
Member Author

Python 2.7 reached end-of-life January 1, 2020. Do we really need to carry __future__ around in pydoc?

The future module is not a 2.7 feature, it's still used (like __annotations__)

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

This LGTM, but since I never touch pydoc apart from the occasional security fix, I'm refraining from approving.

Also, do we need tests for this? Or does pydoc not test this function at all?

Python 2.7 reached end-of-life January 1, 2020. Do we really need to carry future around in pydoc?

Of course! I still want my from __future__ import braces and from __future__ import barry_as_FLUFL ;-).

That aside, yeah Irit added print_function to test that the code works as intended, but it could be any recent non-2.7 __future__.

Lib/pydoc.py Outdated Show resolved Hide resolved
Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

I don't think anyone is actively maintaining pydoc. LGTM on my end.

Lib/pydoc.py Show resolved Hide resolved
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
@iritkatriel iritkatriel merged commit 15ba816 into python:main Mar 28, 2022
@iritkatriel iritkatriel deleted the bpo-26120 branch October 18, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants