Skip to content
Advertisement

Link function1.__doc__ to function2.__doc__

Does anybody know if it is possible to link a function1.__doc__ to a function2.__doc__ without writting it 2 times ?

For example I tried something like:

JavaScript

The last line is what I would like to have.

Thanks ! :)

Advertisement

Answer

you can just assign it at after you define the function.

JavaScript

Since a function is just an object in python with attributes, you can change the attributes to what you want.

Advertisement