[Python-Dev] Python 3.x and bytes

Nick Coghlan ncoghlan at gmail.com
Thu May 19 13:02:12 CEST 2011


On Thu, May 19, 2011 at 6:43 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> For point 2, I'm personally +0 on the idea of having 1-element bytes
> and bytearray objects delegate hashing and comparison operations to
> the corresponding integer object. We have the power to make the
> obvious code correct code, so let's do that. However, the implications
> of the additional key collisions in value based containers may need to
> be explored further.

On further reflection, the key collision and semantics blurring
problems mean I am at best -0 on this particular solution to the
problem (and heading fairly rapidly in the direction of -1).

Best to just go with b'a'[0] and let the optimiser sort it out (PyPy
should handle it automatically, CPython would need work).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list