Ondrej Certik wrote:
When adding these duplicate methods, we should also copy the docstring
automatically, so that it is well documented at one place and the
other methods just copy it somehow.
That should be easy:
class Foo(object):
def some_method(self, x):
"""doc"""
pass
other_method = some_method
help(Foo) then shows that other_method is equal to some_method and one
can lookup the documentation of some_method. Alternatively:
class Foo(object):
def some_method(self, x):
"""doc"""
pass
def other_method(self, x):
self.some_method(x)
other_method.__doc__ = some_method.__doc__
help(Foo) now shows two methods with the same docstring. (Not sure if
that is better.)
cheers,
Toon
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.