Alan G Isaac wrote: > On Fri, 31 Aug 2007, Eric Firing apparently wrote: >> marker='None' is allowed, as is ' ' and ''. Do you need None? > > > I recently returned to some old figures where I did things > like this: > > ls1 = dict(linestyle='-', marker=None, color=(0,0,1), linewidth=2, > zorder=1000) > fig_ax.plot_date(dates, data, **ls1) > > This now fails with a KeyError. > > However changing to marker='' works fine. > I find that a bit less intuitve than marker=None, > but I understand you to say that this should mean "use the default".
Yes, I think that quite some time ago we discussed this and decided to use the string "None" as well as empty strings, and to reserve the Python None for "use the default". I believe it was originally in the context of color specifications, and we then extended it to be a general convention. What is inconsistent is that in some cases one can explicitly use, e.g., marker=None for the default and in other cases, such as the plot command, one cannot. It is a question of whether the kwargs are being passed directly to the initializer or whether they are being applied after initialization via setters. I don't think it would be difficult to remove this inconsistency, and maybe it is worth doing. I'm not inspired to do it immediately, though. Certainly the question should be addresses if the API is redone using traits. Eric ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users