class Mother(SageObject):
def my_method(self):
r"""
Some Documentation.
""""
return 'Bam!'
class Daughter(Mother):
pass
Damn it. Then I another question: Would it cause a slow-down if I overwrite the method with something like
def my_method(self):
r"""
New Documentation
"""
Mother.my_method(self)
Best,
Michael
Damn it. Then I another question: Would it cause a slow-down if I overwrite the method with something like
def my_method(self):
r"""
New Documentation
"""
Mother.my_method(self)
Best,
Michael
Am 19.03.2020 um 00:41 schrieb Michael Orlitzky:
On 3/18/20 5:04 PM, Michael Jung wrote:Dear developers, to reduce redundancies in the SageManifolds code, we plan to inherit most methods and classes from a (mathematically) more general setup. Still, the current documentation is mandatory. Is it possible to establish new documentations for inherited methods?I tried, and I don't think so. If you don't override the method, then the subclass method will literally point to the superclass method, implying that they both have to have the same __doc__.
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/39892653-0f84-5c96-a12f-ac378f8e535b%40uni-potsdam.de.
my_method = Mother.my_method
my_method.__doc__ = "new docstring"
To unsubscribe from this group and stop receiving emails from it, send an email to sage-...@googlegroups.com.
def f(a):
"doc of f"
return 0
import types
g=types.FunctionType(f.__code__,f.__globals__)
g.__doc__="doc of g"
g.__doc__
f.__doc__