Comment #1 on issue 3614 by [email protected]: Named arguments
http://code.google.com/p/sympy/issues/detail?id=3614
This is done in SymPy.stats with the NamedArgsMixin class
class NamedArgsMixin(object):
_argnames = ()
def __getattr__(self, attr):
try:
return self.args[list(self._argnames).index(attr)]
except ValueError:
raise AttributeError("'%s' object has not attribute '%s'" % (
type(self).__name__, attr))
class NormalDistribution(..., NamedArgsMixin):
_argnames = ('mean', 'std')
....
This method depends on __getattr__ which may degrade performance. See
discussion at https://github.com/sympy/sympy/pull/1720
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.