[Python-3000] bytes and dicts (was: PEP 3137: Immutable Bytes and Mutable Buffer)

Adam Hupp adam at hupp.org
Fri Sep 28 20:34:36 CEST 2007


On 9/28/07, Guido van Rossum <guido at python.org> wrote:
> Well, maybe this is a good enough argument to give up. If the best we
> can say is that having a bytes and a str as keys *may* cause a
> TypeError on lookups, I'm not sure it is worth it to try to raise the
> probability that it'll actually be raised...

Would it make sense to have dict ignore TypeError on lookups?
Alternatively, the byte/str comparison could throw a specific subclass
of TypeError that dict ignored e.g. IncompatibleComparisonError.

-- 
Adam Hupp | http://hupp.org/adam/


More information about the Python-3000 mailing list