hasattr + __getattr__: I think this is Python bug

Neil Cerutti neilc at norwich.edu
Tue Jul 20 11:39:42 EDT 2010


On 2010-07-20, dmitrey <dmitrey.kroshko at scipy.org> wrote:
> This doesn't stack with the following issue: sometimes user can
> write in code "myObject.size = (some integer value)" and then
> it will be involved in future calculations as ordinary fixed
> value; if user doesn't supply it, but myObject.size is involved
> in calculations, then the oofun is created to behave like
> similar numpy.array attribute.

Telling them, "Don't do that," is a good solution in Python.

-- 
Neil Cerutti



More information about the Python-list mailing list