Brett Cannon <[EMAIL PROTECTED]> added the comment: On Mon, Aug 18, 2008 at 10:59 AM, Nick Edds <[EMAIL PROTECTED]> wrote: > > Nick Edds <[EMAIL PROTECTED]> added the comment: > > What's the current status of this?
I think it is waiting for someone to work on it. > If nobody is working on it, I would > be willing to give it a shot. Great! > Can somebody just confirm that I have a > correct understanding of the problem. > UserDict.UserDict needs a deprecation warning, UserDict.IterableUserDict > becomes collections.UserDict, and UserDict.Mixin becomes > collections.MutableMapping. In theory, yes, but the superclasses have changed, so I don't know if having a fixer is really the best option in this case since it is not a simple renaming. Perhaps deprecation warnings stating that the classes have been moved and given different superclasses would make more sense? > Then for keys(), items(), and values(), I > want to replace something like d.keys() to list(d.keys()). Sure, but how the heck are you going to get 2to3 to do this properly just for UserDict instances? Doesn't the keys()/values()/items() fixer already do this blindly anyway? > One added question: based on what I gathered from PEP 3106, this last > part is only needed in a situation such as a = d.keys(), but not a > situation like for key in keys:, so because in the later case wrapping > the call to keys() in list() would presumably be suboptimal, is this > something I should try and avoid? I'm not sure exactly how it could be > done, but I have some idea of how it to do it. > Yes, you are right that wrapping the call in a for loop is not needed since code will never come across it. But as I said above, doesn't the fixer for dicts already handle all of this? _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2876> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com