Discussion:
[deprecated list] physParamsAttr -> **physParamsAttr (?)
Vincent Richefeu
2009-07-08 09:56:08 UTC
Permalink
Vaclav,
What happened with physParamsAttr in the python function like
utils.sphere or utils.box?
Does ** before physParamsAttr means that the variable is deprecated?
my scripts fail now with:
RuntimeError: Invalid key: `physParamsAttr'
Thanks for help,
VR

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users-oU9gvf+***@public.gmane.org
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp
Václav Šmilauer
2009-07-08 10:08:32 UTC
Permalink
Post by Vincent Richefeu
Vaclav,
What happened with physParamsAttr in the python function like
utils.sphere or utils.box?
Does ** before physParamsAttr means that the variable is deprecated?
**kw means that reamining arguments will be converted to dictionary.
Therefore, if you had something like args={'arg1':value1,'arg2':value2}
before, you should say

utils.box(..., arg1=value1,arg2=value2)

or, if you are lazy, pass the dictionary but expand it to the arguments
by saying utils.box(...,**args).

(BTW, single * expands tuple to sequence of unnamed arguments in python,
so that f(1,2,3) and args=(1,2,3); f(*args) are the same).

HTH, Vaclav


_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users-oU9gvf+***@public.gmane.org
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp

Loading...