yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #03876
Python question ?
Hi everybody,
I have a python question, which is not really a question..
I noticed few days ago that if I try to access an engine's attribute
which doesn't exist, a clear error message is displayed.
Exampli gratia, if I do:
triax=utils.typedEngine('TriaxialCompressionEngine')
triax.PAPULA
I get an error like this 'TriaxialCompressionEngine' object has no
attribute 'PAPULA'.
But if I do:
triax=utils.typedEngine('TriaxialCompressionEngine')
triax.PAPULA=5
I have no error, but a new attribute is created, named PAPULA (fortunately).
Last week I did a sintax error while trying to access an attribute, and
having no error messages it took to me some time to find the reason of
the strange results I was having.. I do not see the interest to keep
such a possibility, as the new attribute doesn't behave in any case as a
real engine's attribute, but it seems to have the same role as a simple
local variable.
Am I wrong?
Ciao, Emanuele
Follow ups
References