Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-91896: Revert some very noisy DeprecationWarnings forByteString#104424

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
AlexWaygood merged 3 commits intopython:mainfromAlexWaygood:too-noisy
May 13, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygoodAlexWaygood commentedMay 12, 2023
edited
Loading

Emitting aDeprecationWarning every timeByteString is accessed or imported fromcollections.abc ortyping is too noisy, as it effectively forbids anybody from doingfrom collections.abc import * orfrom typing import * if they want to avoidDeprecationWarnings.from typing import *, in particular,appears to be a common idiom so this looks as though it would be too disruptive. This was an error on my part; I'm sorry for the code churn here.

This PR reverts most of#104294, most of#104422, and all of#104416.


📚 Documentation preview 📚:https://cpython-previews--104424.org.readthedocs.build/

Copy link
Member

@JelleZijlstraJelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thanks!

I tried to think of ideas to do this better and couldn't think of anything:

  • RemoveByteString from__all__ for 3.12: this would be a backward compatibility break
  • Change theimport * code to suppress DeprecationWarnings: way too magical
  • In the module__getattr__, somehow detect that we're being called fromimport *: no idea how to do that elegantly

AlexWaygood reacted with thumbs up emoji
@AlexWaygood
Copy link
MemberAuthor

AlexWaygood commentedMay 12, 2023
edited
Loading

Yeah, it's pretty frustrating that there isn't a better way of doing this :(

And this only happensbecausecollections.abc andtyping are following "best practices" and defining__all__.from ast import * doesn't cause any deprecation warnings to be emitted, even after376137f, becauseast doesn't define__all__, so the* import just looks at what's inglobals(), and the module-level__getattr__ method is never triggered.

It feels somewhat perverse that defining__all__ makes life more difficult here :(

Fidget-Spinner reacted with confused emoji

@AlexWaygoodAlexWaygood merged commitc527eb1 intopython:mainMay 13, 2023
@AlexWaygoodAlexWaygood deleted the too-noisy branchMay 13, 2023 08:55
carljm added a commit to carljm/cpython that referenced this pull requestMay 15, 2023
* main: (29 commits)pythongh-101819: Fix _io clinic input for unused base class method stubs (python#104418)pythongh-101819: Isolate `_io` (python#101948)  Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (python#104501)pythongh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (python#104495)pythongh-104050: Run mypy on `clinic.py` in CI (python#104421)pythongh-104490: Consistently define phony make targets (python#104491)pythongh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined (python#104473)pythongh-104487: PYTHON_FOR_REGEN must be minimum Python 3.10 (python#104488)pythongh-101282: move BOLT config after PGO (pythongh-104493)pythongh-104469 Convert _testcapi/float.c to use AC (pythongh-104470)pythongh-104456: Fix ref leak in _ctypes.COMError (python#104457)pythongh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (python#104474)pythongh-104337: Clarify random.gammavariate doc entry  (python#104410)  Minor improvements to typing docs (python#104465)pythongh-87092: avoid gcc warning on uninitialized struct field in assemble.c (python#104460)pythonGH-71383: IDLE - Document testing subsets of modules (python#104463)pythongh-104454: Fix refleak in AttributeError_reduce (python#104455)pythongh-75710: IDLE - add docstrings and comments to editor module (python#104446)pythongh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (python#104424)  Add a mention of PYTHONBREAKPOINT to breakpoint() docs (python#104430)  ...
carljm added a commit to carljm/cpython that referenced this pull requestMay 15, 2023
* main: (204 commits)pythongh-101819: Fix _io clinic input for unused base class method stubs (python#104418)pythongh-101819: Isolate `_io` (python#101948)  Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (python#104501)pythongh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (python#104495)pythongh-104050: Run mypy on `clinic.py` in CI (python#104421)pythongh-104490: Consistently define phony make targets (python#104491)pythongh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined (python#104473)pythongh-104487: PYTHON_FOR_REGEN must be minimum Python 3.10 (python#104488)pythongh-101282: move BOLT config after PGO (pythongh-104493)pythongh-104469 Convert _testcapi/float.c to use AC (pythongh-104470)pythongh-104456: Fix ref leak in _ctypes.COMError (python#104457)pythongh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (python#104474)pythongh-104337: Clarify random.gammavariate doc entry  (python#104410)  Minor improvements to typing docs (python#104465)pythongh-87092: avoid gcc warning on uninitialized struct field in assemble.c (python#104460)pythonGH-71383: IDLE - Document testing subsets of modules (python#104463)pythongh-104454: Fix refleak in AttributeError_reduce (python#104455)pythongh-75710: IDLE - add docstrings and comments to editor module (python#104446)pythongh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (python#104424)  Add a mention of PYTHONBREAKPOINT to breakpoint() docs (python#104430)  ...
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

@gvanrossumgvanrossumAwaiting requested review from gvanrossum

@Fidget-SpinnerFidget-SpinnerAwaiting requested review from Fidget-Spinner

@rhettingerrhettingerAwaiting requested review from rhettingerrhettinger is a code owner

@hauntsaninjahauntsaninjaAwaiting requested review from hauntsaninja

Assignees
No one assigned
Labels
3.12only security fixesskip news
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@AlexWaygood@JelleZijlstra@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp