You're right.  My angle is I just want the setters and getters.  Writing
set_ and get_ feels like the C++ prison I thought I had escaped :)

I'll keep an eye for the discussion on this topic since this is interesting
to me for other reasons as well.  (I had to code something like params for
my own code).

Best,

Neil

On Wed, May 13, 2015 at 11:42 PM, Benjamin Root <ben.r...@ou.edu> wrote:

> Manpower, really. Also, there be dragons deep in that code (I'll leave it
> as an exploration task for you to figure out how aliases are done).
>
> There have been a few proposals, but they keep suffering from scope creep.
> Take a look at the MEP page.
>
> Keep in mind that reducing Lines of Code just for the sake of reducing
> lines of code isn't all that useful. The current code isn't broken, and
> there are no plans to add more properties, so it isn't much of a hinderance
> (compared to other aspects of the codebase). But a proposal that makes
> validation and style-handling (or some such) would be valuable.
>
> Cheers!
> Ben Root
> On May 13, 2015 11:06 PM, "Neil Girdhar" <mistersh...@gmail.com> wrote:
>
>> 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
>>
>>
------------------------------------------------------------------------------
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