pyblish / pyblish-base

Pyblish base library - see https://github.com/pyblish/pyblish for details.
Other
127 stars 59 forks source link

Registered plug-ins lose their docstring #276

Closed mottosso closed 8 years ago

mottosso commented 8 years ago

Because registered plug-ins are implicitly subclassed (see #272), they lose their docstring.

import pyblish.api

class MyPlugin(pyblish.api.ContextPlugin):
  """My docstring"""

pyblish.api.register_plugin(MyPlugin)
pyblish.api.registered_plugins()[0].__doc__ == ""

Expected

Docstring attribute should remain.

Solution

When subclassing, copy docstring to subclass.