[Python-Dev] 'hasattr' is broken by design

Benjamin Peterson benjamin at python.org
Mon Aug 23 22:13:51 CEST 2010


2010/8/23 Michael Foord <fuzzyman at voidspace.org.uk>:
> To me hasattr *looks* like a passive introspection function, and the fact
> that it can trigger arbitrary code execution is unfortunate - especially
> because a full workaround is pretty arcane.

That's the danger of a dynamic language like Python. Even dir() can
now trigger things like that.


-- 
Regards,
Benjamin


More information about the Python-Dev mailing list