I don't want to ruffle any feathers, and I'm sure this comes up all the
time, but I'm wondering why don't we have a decorator on classes that
generates all of the boilerplate methods?

For example:

@generate_boilerplate([('linestyle', 'ls'), …]
class Patch(…):

would generate

get_ls, set_ls to point to get_linestyle and set_linestyle and their
docstrings

and would generate

linestyle = property(get_linestyle, set_linestyle) and their docstring.

This would reduce a lot of boilerplate code and provide the modern getters
and setters.  In the future, a user could enable an option to disable the
old style interface and remove it from 'dir', etc.

What's the reason for not providing the "new"-style getters and setters?
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to