[Python-3000] PEP 3137: Immutable Bytes and Mutable Buffer

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Sep 28 03:37:50 CEST 2007


Alexandre Vassalotti wrote:
> Personally, I wouldn't mind writing either this:
> 
>    for b in bytes:
>      if b == b'a'[0]:
>        pass

Well, I would mind, because it's needlessly verbose
and inefficient.

I still think that c'x' is the least bad solution. As long
as we're wanting to write arrays of integers by means of
their corresponding ASCII characters, it makes sense to
be able to do that for a single integer as well.

So my current vote is:

   a) Indexing bytes or buffer gives an integer

   b) Have a c'x' notation for expressing a single
      integer

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-3000 mailing list