"parent" in a class __init__ def?

bruno at modulix onurb at xiludom.gro
Mon Jun 12 10:44:11 CEST 2006


akameswaran at gmail.com wrote:
(meta : please don't top-post)
>  Intuitively, the name lookup on
> self.parent.foo would be faster than if you passed in the object in
> question


Each dot means doing a lookup in a namespace. The more dots, the more
lookups. And lookups do have a cost.

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list