[me]
> > A more useful relationship is
> >
> >     name in dir(x) <==> getattr(x, name) is valid

[Raymond]
> That would be a useful invariant.

Well, the <== part can't really be guaranteed due to the existence of
__getattr__  overriding (and all bets are off if __getattribute__ is
overridden!), but apart from those, stripping non-strings in dir()
would be a big help towards making the invariant true. So I'm +1 on
that.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
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