In responding to an inquiry about an exception raised when using

"plot(..., markerfacecolor=None)"

(http://www.mail-archive.com/[EMAIL PROTECTED]/msg07627.html)

I made a small change to avoid the problem.  My question is, should the 
following be raised to a general principle, to be followed with at most 
  rare exceptions?

Whenever there is a setter for an artist property, that setter should be 
used in the artist __init__method, with no additional logic, so that a 
kwarg setting in __init__ has the same effect as calling the artist 
update method with that kwarg.

This affects plot in particular because the line property kwargs are not 
used via the __init__ method but are applied by calling update(). 
Typically there is some logic along the lines

if kw is None:
     kw = defkw

and I am suggesting that this handling of None as a default should 
always be moved to a setter if one exists.  That way, a user can always 
get a property back to its default value by setting it to None.

Does anyone immediately see any problem or disadvantage in this?  (I 
have not looked through the code carefully myself, so I could easily be 
missing something.)

Eric

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to