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

Meta issue: clean up redundant compat code #100176

Closed
hugovk opened this issue Dec 11, 2022 · 3 comments · Fixed by #101853
Closed

Meta issue: clean up redundant compat code #100176

hugovk opened this issue Dec 11, 2022 · 3 comments · Fixed by #101853
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@hugovk
Copy link
Member

hugovk commented Dec 11, 2022

Bug report

There's several places that have compatibility code for EOL and unsupported Python versions.

We can modernise the code by removing the obsolete bits.

I'll open separate PRs to keep the changes focused by area, and intend to use this meta issue for them all (but can also open separate issues if preferred).

Linked PRs

@hugovk hugovk added the type-bug An unexpected behavior, bug, or error label Dec 11, 2022
hugovk added a commit to hugovk/cpython that referenced this issue Dec 11, 2022
Python 3.2 has been EOL since 2016-02-20 and 2.7 since 2020-01-01, so we
can remove this old compatibility check and unindent the old else-block.

Also, in the unindented block, replace a .format() call with an f-string.

Plus similar changes in the documentation.
hauntsaninja added a commit to hauntsaninja/cpython that referenced this issue Dec 12, 2022
…inic

- clinic.py actually requires at least Python 3.6
- This check will fail if there is a 4.0
hugovk added a commit to hugovk/cpython that referenced this issue Dec 12, 2022
Python 3.2 has been EOL since 2016-02-20 and 2.7 since 2020-01-01, so we
can remove this old compatibility check and unindent the old else-block.

Also, in the unindented block, replace a .format() call with an f-string.

Plus similar changes in the documentation.
vsajip pushed a commit that referenced this issue Dec 14, 2022
)

gh-100176: Remove redundant compat code for Python 3.2 and older

Python 3.2 has been EOL since 2016-02-20 and 2.7 since 2020-01-01, so we
can remove this old compatibility check and unindent the old else-block.

Also, in the unindented block, replace a .format() call with an f-string.

Plus similar changes in the documentation.
@hugovk hugovk self-assigned this Dec 14, 2022
carljm added a commit to carljm/cpython that referenced this issue Dec 14, 2022
* main: (103 commits)
  pythongh-100248: Add missing `ssl_shutdown_timeout` parameter in `asyncio` docs (python#100249)
  Assorted minor fixes for specialization stats. (pythonGH-100219)
  pythongh-100176: venv: Remove redundant compat code for Python <= 3.2 (python#100177)
  pythonGH-100222: Redefine _Py_CODEUNIT as a union to clarify structure of code unit. (pythonGH-100223)
  pythongh-99955: undef ERROR and SUCCESS before redefining (fixes sanitizer warning) (python#100215)
  pythonGH-100206: use versionadded for the addition of sysconfig.get_default_scheme (python#100207)
  pythongh-81057: Move _Py_RefTotal to the "Ignored Globals" List (pythongh-100203)
  pythongh-81057: Move Signal-Related Globals to _PyRuntimeState (pythongh-100085)
  pythongh-81057: Move faulthandler Globals to _PyRuntimeState (pythongh-100152)
  pythongh-81057: Move tracemalloc Globals to _PyRuntimeState (pythongh-100151)
  pythonGH-100143: Improve collecting pystats for parts of runs (pythonGH-100144)
  pythongh-99955: standardize return values of functions in compiler's code-gen (python#100010)
  pythongh-79218: Define `MS_WIN64` macro for Mingw-w64 64bit on Windows (pythonGH-100137)
  Fix: typo (Indention) (pythonGH-99904)
  pythongh-96715 Remove redundant NULL check in `profile_trampoline` function (python#96716)
  pythongh-100176: remove incorrect version compatibility check from argument clinic (python#100190)
  clarify the 4300-digit limit on int-str conversion (python#100175)
  pythongh-70393: Clarify mention of "middle" scope (python#98839)
  pythongh-99688: Fix outdated tests in test_unary (python#99712)
  pythongh-100174: [Enum] Correct PowersOfThree example. (pythonGH-100178)
  ...
@sobolevn
Copy link
Member

sobolevn commented Jan 8, 2023

While looking at this, I got interested: do we even need https://github.com/python/cpython/blame/main/Tools/stringbench/stringbench.py ? It has some python2/3 compat code and the last changes to it was 10 years ago. It is clearly not up-to-date. I will raise this question on discuss.python.org

@sobolevn
Copy link
Member

sobolevn commented Jan 8, 2023

https://discuss.python.org/t/do-we-still-need-tools-io-cc-string-bench/22557

@hugovk
Copy link
Member Author

hugovk commented Feb 12, 2023

Please see PR #101853 to remove Tools/{io,cc,string}bench

hugovk added a commit that referenced this issue Apr 8, 2023
…3.2 (#100197)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
warsaw pushed a commit to warsaw/cpython that referenced this issue Apr 11, 2023
…on <= 3.2 (python#100197)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@iritkatriel iritkatriel added the stdlib Python modules in the Lib dir label Nov 28, 2023
hugovk added a commit that referenced this issue Feb 17, 2024
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this issue Mar 4, 2024
…1853)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
…1853)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants