New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write UserDict fixer for 2to3 #47125
Comments
In Python 3.0, the UserDict module was removed and the UserDict class was |
This doesn't make any sense to me. The 2.6 code runs fine as-is. The |
You only kept the UserDict class, right? Well, that means you need to |
And it is a release blocker as we are trying to get all deprecations into |
The DictMixin class gets renamed to collections.MutableMapping. So, it |
The that needs to be added to 2to3. |
Raymond, can you tell me exactly where each module-level thing in UserDict |
UserDict.UserDict is gone. The new classes comform to the new dict API, so they fixer needs to |
I don't know if 2to3 can handle the class renames. Up to this point we Collin, how doable is this? |
It's doable, but there's no existing support similar to what fix_imports I won't have time to work on this for the foreseeable future, but if |
There is a possible patch in bpo-2046. |
What's the current status of this? If nobody is working on it, I would |
On Mon, Aug 18, 2008 at 10:59 AM, Nick Edds <report@bugs.python.org> wrote:
I think it is waiting for someone to work on it.
Great!
In theory, yes, but the superclasses have changed, so I don't know if
Sure, but how the heck are you going to get 2to3 to do this properly
Yes, you are right that wrapping the call in a for loop is not needed |
Ahh right. I totally forgot that there was already a fix_dict.py that |
I've been thinking about this a bit, and I don't see how handling it For import UserDict, we can just change UserDict to collections and deal For from imports, we can raise the deprecation warning on UserDict, and For the other import cases, similar things could be done. I think the old version of fix_imports, which had support like this, Is there something I'm missing here about the difference between modules |
As I said, it isn't using the import filter, it's whether this should be I really should ask on python-dev about this. |
You know what, Nick, go for the fixer. UserDict.UserDict will need a And I can handle the deprecation if you want. |
How soon is this needed by? I probably won't have a chance to do it in |
On Sun, Aug 24, 2008 at 3:00 PM, Nick Edds <report@bugs.python.org> wrote:
rc1 is Sep. 3, with rc3 Sep 17 (at the moment). Hitting either should |
I still don't see why this is a release blocker. Adding a 2to3 fixer Adding a Py3k warning shouldn't be a release blocker, either - I think Tentatively lowering the priority to normal. |
Sorry about the delay with this. I've finally found some time to work on |
I have the functionality for this working, and will post it tomorrow |
Here is a fixer and test suite for the UserDict. It doesn't do a very |
Could somebody else take a look at this and check in it if it looks |
The patch looks very good over all. However, I'm not completely sure |
Also, I believe the variable initializations at the beginning of the |
What's the consensus on this? I ask since I actually ran into code today that uses DictMixin and as such wasn't converted by the 2to3 tool. |
UserDict.DictMixin needs to convert to collections.MutableMapping |
Converting DictMixin to collections.MutableMapping is not necessarily a complete solution. MutableMapping does not provide all the methods that DictMixin does. See for example the problems encountered in bpo-7975. |
Closing since 2.7 is already out the door. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: