On Tue, Dec 27, 2005 at 01:50:37PM -0800, Alex Martelli wrote:

I'll answer here for all the people who kindly answered.

> Why would that be better than
> any(o.some_attribute for o in some_objects)
> ?

I think it's because lately I've been using common lisp a lot and the approach
with the test function is pretty common there.

Of course I already knew all the alternatives using map and the generator
expression, but I felt like mine was clearer for a reader, this is probably
true but not enough to justify the change.

One reason was to hide the iteration from the user and let python handle
it, but I can see that this is both not enough and probably not even so
necessary since the iteration protocol is already 'hidden' when using for..in.

> What am I missing?

Nothing, it's just me and the bad influence that lisp has on my mind :).
Sorry to bother the list then. Thanks for the kind replies.

-- 
Valentino Volonghi aka Dialtone
Now Running MacOSX 10.4
Blog: http://vvolonghi.blogspot.com
http://weever.berlios.de

Attachment: pgpeKPBtN4P2s.pgp
Description: PGP signature

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to