-
-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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
Small _abcoll Bugs / Oddities #46479
Comments
_abcoll.py references intertools.chain but doesn't import it. This And the third oddity in that module is that Callable defines an abstract |
I fixed the import in r61211. Raymond, can you sort out the set operations? |
Leaving the other one for Guido. I suspect the __radd__ style methods |
I'm setting this to critical to ensure that I will at least have a |
Ping. |
There's been no activity on this, but I don't believe it's serious |
Recommend dealing with this in 3.1. |
Thanks Raymond. Lowering the priority to critical and pushing this back |
I'm not going to get to this. |
3.1 is long gone. Should this be addressed for 3.2? |
Yes, if you have a chance to think it through, it would be nice to get this fixed-up. |
Minor point of clarity: you mean __rand__ not __radd__, right? Set objects do not support addition at all. Adding the __rand__ methods to collections.Set in and of itself is straightforward: def __rsub__(self, other):
return self._from_iterable(other) - self
__ror__ = __or__
__rand__ = __and__
__rxor__ = __xor__ I'm not sure I understand the can of worms. While replacing concrete tests with abstract tests may be worthwhile goal in its own right, why is it necessary to solve the particular shortcoming of missing __r* methods? Probably I'm missing something. With just the minimal change above, what kinds of things do you expect to fail? (assuming bpo-8743 is also fixed) |
Raymond, Do you have around 10 minutes today to look at the patch I submitted in bpo-8743? It appears to solve both this issue and that one, which have priorities critical and high, respectively. It's a reasonably small patch: around 20 lines changed plus 20 lines added, all Python code. Here's a direct link: http://bugs.python.org/file20045/set-with-Set.patch If it looks good to you, I'd like to commit it in time for 3.2b2 so that it gets as much exercise as possible before 3.2-final. Earlier you had expressed that adding the __rand__ methods to collections.Set would be tricky issue, so I'm concerned that I have overlooked something important and obvious. (Feedback from others is, of course, welcome as well) |
Bump. |
Armin pointed out in http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/ that one nasty consequence of the remaining part of this bug and bpo-8743 is making it much harder than it should be to use the ItemsView, KeysView and ValuesView from collections.abc to implement third party mappings that behave like the builtin dict. |
Raymond, will you have a chance to look at this before 3.4rc1? Otherwise I'd like to take it. |
Yes, I'll have a look shortly. |
With the only remaining issue here being the misbehaviour of the Set and MutableSet ABCs when dealing with other types (the other issues in Armin's original report were much simpler and fixed promptly), I'm closing this as a duplicate of bpo-8743 (where I just uploaded an up to date patch based on the patch Daniel linked to above) |
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: