From: Norbert N. <Nor...@gm...> - 2004-11-24 08:22:58
|
Am Dienstag, 23. November 2004 22:07 schrieb John Hunter: > >>>>> "Fernando" == Fernando Perez <Fer...@co...> writes: > > Fernando> Quick heads-up: > > Fernando> Python 2.2 dicts do NOT have a pop() method, this > Fernando> appeared in python 2.3. It's fine if you decide to make > Fernando> matplotlib fully 2.3-dependent, but I just wanted to > Fernando> make you at least aware of this fact. 2.2 is still in > Fernando> reasonably wide use in the field, so if you are going to > Fernando> drop support for it, you might want to put a big fat > Fernando> warning about this fact, just to save users the hassle > Fernando> of weird bugs. > > Ahh, thanks for your vigilance. I do plan to continue to support 2.2 > as long as possible, except for the known issues: datetime and > mathtext. I reverted all the pops to gets. I also made some > enhancements to backend_driver to better work with python2.2 - it now > takes the python to run as a parameter and skips tests where 2.2 is > already known to fail. > > Hopefully, I'll remember to be vigilant to test 2.2 before each > release. Ouch, sorry, I do not even have 2.2 installed. Guess with that information, the whole patch becomes bogus. On the other hand: simpy reverting pop to get leaves you with the old problem: you have to drop the check for emptyness of kwargs since legal arguments are not removed after use. If, on the other hand, you remove this check, erraneous (p.e. misspelled) arguments are just silently ignored. Maybe, a wrapper would solve the problem? How would one code a replacement for pop that works on 2.2 as well? Probably easiest by using get and del within a try..except block? The wrapper could then have a clear note how to replace it once 2.3 becomes mandatory sometimes in the future. -- _________________________________________Norbert Nemec Bernhardstr. 2 ... D-93053 Regensburg Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199 eMail: <No...@Ne...> |