| 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 |
|---|---|---|
| Expand Up | @@ -1064,8 +1064,27 @@ def count(self, value): | |
| Sequence.register(range) | ||
| Sequence.register(memoryview) | ||
|
|
||
|
|
||
| class ByteString(Sequence): | ||
| class _DeprecateByteStringMeta(ABCMeta): | ||
| def __new__(cls, name, bases, namespace, **kwargs): | ||
| if name != "ByteString": | ||
| import warnings | ||
|
|
||
| warnings._deprecated( | ||
|
Comment thread
hauntsaninja marked this conversation as resolved.
|
||
| "collections.abc.ByteString", | ||
| remove=(3, 14), | ||
| ) | ||
| return super().__new__(cls, name, bases, namespace, **kwargs) | ||
|
|
||
| def __instancecheck__(cls, instance): | ||
| import warnings | ||
|
|
||
| warnings._deprecated( | ||
| "collections.abc.ByteString", | ||
| remove=(3, 14), | ||
| ) | ||
| return super().__instancecheck__(instance) | ||
|
|
||
| class ByteString(Sequence, metaclass=_DeprecateByteStringMeta): | ||
|
Comment thread
hauntsaninja marked this conversation as resolved.
|
||
| """This unifies bytes and bytearray. | ||
|
|
||
| XXX Should add all their methods. | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityYou can also remove this comment.
Sorry, something went wrong.
All reactions
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Deprecate :class:`collections.abc.ByteString` | ||
|
Comment thread
hugovk marked this conversation as resolved.
|
||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.