En Thu, 08 Apr 2010 21:02:23 -0300, Patrick Maupin <pmau...@gmail.com> escribió:
On Apr 8, 6:35 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.ar> wrote:

The CPython source contains lots of shortcuts like that. Perhaps the checks should be stricter in some cases, but I imagine it's not so easy to fix: lots of code was written in the pre-2.2 era, assuming that internal types were not subclassable.

I don't know if it's a good "fix" anyway.  If you subclass an internal
type, you can certainly supply your own rich comparison methods, which
would (IMO) put the CPU computation burden where it belongs if you
decide to do something goofy like subclass a list and then override
__len__.

We're all consenting adults, that's the Python philosophy, isn't it?
If I decide to make stupid things, it's my fault. I don't see why Python should have to prevent that.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to