On Tue, Aug 24, 2010 at 7:49 AM, Michael Foord <fuzzy...@voidspace.org.uk> wrote: > Certainly that is true for len. getattr obviously involves invoking code if > you are fetching a property or descriptor. No idea how you conclude that > hasattr executing code adds flexibility to the language though.
Proxy objects like the one in the weakref module don't work if hasattr() doesn't implicitly invoke __getattr__. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ 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