Visitar URL original
bpo-26120: make pydoc exclude __future__ imports from the data block of the module by iritkatriel · Pull Request #30888 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20221031101300/https://github.com/python/cpython/pull/30888
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
@iritkatriel iritkatriel requested a review from tim-one Jan 25, 2022
@arhadthedev
Copy link
Contributor

arhadthedev commented Jan 25, 2022

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

iritkatriel commented Jan 25, 2022

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

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
@iritkatriel iritkatriel requested a review from rhettinger Jan 25, 2022
Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

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
12 checks passed
@iritkatriel iritkatriel deleted the bpo-26120 branch Oct 18, 2022
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants