[Python-Dev] Python 3.x and bytes
v+python at g.nevcal.com
Wed May 18 07:46:34 CEST 2011
On 5/17/2011 10:39 PM, Greg Ewing wrote:
> Personally I think that the default literal syntax for
> bytes, and also the form produced by repr(), should have
> been something more neutral, such as hex, with the ascii
> form available for use when it makes sense.
> Much nicer would be
> some_var = x'deadbeef'
> As for
>> --> some_other_var == b'd'
> there ought to be a literal for specifying an integer
> using an ascii character, so you could say something like
> if some_other_var == c'd':
> which would be equivalent to
> if some_other_var == ord(b'd')
> but without the overhead of computing the value each time
> at run time.
Seems this could be added compatibly?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev