SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] Question about getters and setters.

From: Benjamin R. <ben...@ou...> - 2015年05月14日 03:43:05
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" <mis...@gm...> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
>

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /