| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| :class:`collections.abc.ByteString` has been removed from | ||
| ``collections.abc.__all__``, and :class:`typing.ByteString` has been removed | ||
| from ``typing.__all__``. The former has been deprecated since Python 3.12, | ||
| and the latter has been deprecated since Python 3.9. Both classes are | ||
| scheduled for removal in Python 3.17. | ||
|
|
||
| Additionally, the following statements now cause ``DeprecationWarning``\ s to | ||
| be emitted at runtime: ``from collections.abc import ByteString``, ``from | ||
| typing import ByteString``, ``import collections.abc; | ||
| collections.abc.ByteString`` and ``import typing; typing.ByteString``. Both | ||
| classes already caused ``DeprecationWarning``\ s to be emitted if they were | ||
| subclassed or used as the second argument to ``isinstance()`` or | ||
| ``issubclass()``, but they did not previously lead to | ||
| ``DeprecationWarning``\ s if they were merely imported or accessed from their | ||
| respective modules. |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis means only the first time anyone does from collections.abc import ByteString in a program will trigger a warning, right? That seems potentially problematic: maybe the first time is in some dependency you don't control, so you ignore the warning, and then it happens again in your code and you miss it.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThat's correct. I did that deliberately so that the warning wouldn't be too noisy, and since it's what we previously did for other modules such as ast:
cpython/Lib/ast.py
Lines 1897 to 1905 in d065edf
But I'm happy to switch to it emitting the deprecation warning even on subsequent imports, if you prefer! It would simplify the implementation a little
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityProbably OK to stick with the standard format here, hopefully it's enough to get people to notice...
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.