project8 / dripline

Slow controls for medium scale physics experiments based on AMQP centralized messaging
http://www.project8.org/dripline
1 stars 0 forks source link

fancy docstring magic #129

Closed laroque closed 9 years ago

laroque commented 9 years ago

A feature request of rather low priority.....

Dripline makes use of multi-generation inheritance at times, and __init__() uses catching and passing **kwargs to allow mix-in classes to add/combine features. One result is that it can be hard to know exactly what set of kwargs is valid for a particular class, especially for anyone other than Ben (and therefore didn't write them all).

Suggestion: Use a class's doc string to describe what it does, and require that the doc string for init's to just be the names and descriptions of the kwargs accepted. A decorator could then be written for the class, which uses introspection to get the full inheritance structure and combine the doc strings for the full set of init functions and append them to the class's doc.... it is gunna be so sweet.

laroque commented 9 years ago

done, now you can from dripline.core.utilities import fancy_doc then decorate your class with @fancy_doc... in develop