Re: [Python-ideas] A way to subscript a single integer from bytes
Whoops! Never seen that before. Nothing I searched up pointed me to it. Sorry for wasting your time! Ken; -- Sincerely, Ken;
I think this method is easy to miss, since people look at the docs for
bytes (e.g. using dir(bytes)). It might be worthwhile to either add a
`bytes.to_int(...)` method (better, IMHO), or to point to int.from_bytes on
the relevant part of the docs.
Elazar
On Tue, May 1, 2018 at 5:09 PM Ken Hilton
Whoops! Never seen that before. Nothing I searched up pointed me to it. Sorry for wasting your time!
Ken; -- Sincerely, Ken; _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
I think this method is easy to miss, since people look at the docs for bytes (e.g. using dir(bytes)). It might be worthwhile to either add a `bytes.to_int(...)` method (better, IMHO), or to point to int.from_bytes on the relevant part of the docs.
Elazar
A note in the docs about int.from_bytes seems more than warranted to me to. Jacco
participants (3)
-
Elazar
-
Jacco van Dorp
-
Ken Hilton