python complain

a thing always messes me up is that

bytes([42])

evaluates to a byte sequence with one element (42), while

bytes(42)

evaluates to a byte sequence of 42 zeroes. the latter behavior is really weird to me, since it's not analogous with other sequence-y constructors like list() or str(). (personally i'd prefer for bytes(42) to raise a TypeError like list(42) does.) the original bytes PEP sheds no light on why this behavior was chosen peps.python.org/pep-0358/

0

If you have a fediverse account, you can quote this note from your own instance. Search https://friend.camp/users/aparrish/statuses/116235235124901462 on your instance and quote it. (Note that quoting is not supported in Mastodon.)