Hi,

I saw that a discussion started on transitioning to the use of properties
instead of explicit getters and setters, which seems like a very good idea
to me... so I thought this would be a good idea to get involved in
matplotlib-devel :)

Right now an issue raised is what to do with set_* that take multiple
arguments.  Taking set_title, which takes both positional and keyword
arguments, as an example, my idea would be to do

ax.title = "A title"
ax.title.fontdict = fontdict

Basically, a property "foo" (in the matplotlib meaning of the word) becomes
a descriptor with __get__ => get_foo and __set__ => set_foo, and keyword
arguments to the old property setter become themselves descriptors on that
descriptor.

Antony
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to