Guido> Anyway, if we really do have enough use cases for byte array Guido> literals, we might add them. I still think that would be Guido> confusing though, because byte arrays are most useful if they are Guido> mutable: and then we'd have mutable literals -- blechhhh! Today I can initialize mutable objects from immutable strings: >>> print list("abc") ['a', 'b', 'c'] >>> print set("abc") set(['a', 'c', 'b']) I see no reason that mutable bytes objects couldn't be created from otherwise immutable sequences either. Would it be a problem to ensure that a = b"abc" b = b"abc" print a is b prints False? The main difference as I see it is that byte literals would be completely devoid of any sort of interpretation as unicode sequences. It would be nice if this was possible: # -*- coding: utf-8 -*- b = b"รข" though that would probably wreak havoc with editors and hex escapes would have to be used in most situations. Skip
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4