On Tuesday 17 July 2007 12:04:54 pm John Hunter wrote:
> > I was wondering, though, whether there'd be any support for some work
> > which tidied up the near-duplicate code in axes.py.  I've been playing
>
> Certainly, but probably not using meta-classes.
>
> > around with an approach using python's metaclass support, which, for
> > example, would replace the definitions of the two near-identical
> > functions set_xscale() and set_yscale() with the one meta-definition:
> >
> >     @MC_Traited.construct_traited_variants
> >     def set__AXISLETTER_scale(self, value, base_AXISLETTER_ = 10,
> > subs_AXISLETTER_ = None): """
> >         SET_%(axis_letter_UC)sSCALE(value, base%(axis_letter)s = 10,
> > subs%(axis_letter)s = None)
>
> I'm disinclined to use python black magic -- I find it makes the code
> harder to grok for the typical scientist, and these are our main
> developers.  Most of these guys are still trying to figure out what a
> class is <wink>

It's true. That bit of code looks like Perl to me.

Darren

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to