-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-129349: Accept bytes in bytes.fromhex()/bytearray.fromhex() #129844
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
Changes from all commits
81d7ea2
ea02542
76d28ce
cff091c
be92188
b0e3eb5
ef92b4e
685f583
f859c3c
31b9ab0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -354,6 +354,10 @@ Other language changes | |
(with :func:`format` or :ref:`f-strings`). | ||
(Contrubuted by Sergey B Kirpichev in :gh:`87790`.) | ||
|
||
* The :func:`bytes.fromhex` and :func:`bytearray.fromhex` methods now accept | ||
ASCII :class:`bytes` and :term:`bytes-like objects <bytes-like object>`. | ||
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. Question: are bytes also bytes-like objects? if so, you can just link the term. Or more generally, isn't it objects that support the buffer protocol? 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. Yes, but it seems less accessible to users to just link Maybe the fault is with So I hedged and did both. 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. You could sa "that support the buffer protocol such as memoryviews" and add a link to whatever example of a type that supports the buffer protocol you used 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. I prefer to say "bytes and bytes-like", it's more explicit. |
||
(Contributed by Daniel Pope in :gh:`129349`.) | ||
|
||
* ``\B`` in :mod:`regular expression <re>` now matches empty input string. | ||
Now it is always the opposite of ``\b``. | ||
(Contributed by Serhiy Storchaka in :gh:`124130`.) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
:meth:`bytes.fromhex` and :meth:`bytearray.fromhex` now accepts ASCII | ||
:class:`bytes` and :term:`bytes-like objects <bytes-like object>`. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.