all() is slow?
Ian Kelly
ian.g.kelly at gmail.com
Thu Nov 10 16:19:18 EST 2011
On Thu, Nov 10, 2011 at 1:37 PM, Devin Jeanpierre
<jeanpierreda at gmail.com> wrote:
> Of course not. I do, however, think that it's conceivable that I'd
> want to key a namedtuple by an invalid identifier, and to do that,
> yes, I'd need to use getattr().
Care to give a real use case? You could even go a step further and
use, say, arbitrary ints as names if you're willing to give up
getattr() and use "ob.__class__.__dict__[42].__get__(ob,
ob.__class__)" everywhere instead. The fact that somebody might
conceivably want to do this doesn't make it a good idea, though.
I do find it a bit funny that you're criticizing a somewhat smelly
implementation detail by complaining that it doesn't support an
equally smelly feature.
Cheers,
Ian
More information about the Python-list
mailing list