msg63232 - (view) |
Author: Armin Ronacher (aronacher) * |
Date: 2008-03-03 21:24 |
_abcoll.py references intertools.chain but doesn't import it. This
breaks Set subclasses. Additionally the abstract base classes don't
provide the right hand operator callbacks or how you want to call them.
So __add__ is there but __radd__ not which for example leads to the
problem that "foo() + set()" works but "set() + foo" not.
And the third oddity in that module is that Callable defines an abstract
method for __contains__ which makes no sense but none for __call__.
|
msg63233 - (view) |
Author: Georg Brandl (georg.brandl) * |
Date: 2008-03-03 21:26 |
I fixed the import in r61211.
Raymond, can you sort out the set operations?
|
msg63240 - (view) |
Author: Raymond Hettinger (rhettinger) * |
Date: 2008-03-03 22:22 |
* Removed the dependency on itertools: r61213.
* Fixed nasty cut-and-paste error in Callable: r61214
Leaving the other one for Guido. I suspect the __radd__ style methods
are can of worms best left unopened for now. The right solution
probably involves visiting every piece of code in Python that makes a
concrete isinstance/issubclass test and replacing it with an abstract
test. That may have unexpected side-effects, may be hard to test, and
may kill performance.
|
msg63861 - (view) |
Author: Guido van Rossum (gvanrossum) * |
Date: 2008-03-18 03:04 |
I'm setting this to critical to ensure that I will at least have a
thorough look at this before the release. I'm not sure whether I will
decide to address it or leave it alone.
|
msg70460 - (view) |
Author: Benjamin Peterson (benjamin.peterson) * |
Date: 2008-07-31 01:56 |
Ping.
|
msg72454 - (view) |
Author: Barry A. Warsaw (barry) * |
Date: 2008-09-04 01:52 |
There's been no activity on this, but I don't believe it's serious
enough to block the release.
|
msg72469 - (view) |
Author: Raymond Hettinger (rhettinger) * |
Date: 2008-09-04 02:49 |
Recommend dealing with this in 3.1.
The __radd__ issue is non-trivial
and can't easily be dealt with at this point.
|
msg72471 - (view) |
Author: Barry A. Warsaw (barry) * |
Date: 2008-09-04 02:50 |
Thanks Raymond. Lowering the priority to critical and pushing this back
to 3.1.
|
msg79229 - (view) |
Author: Guido van Rossum (gvanrossum) * |
Date: 2009-01-06 05:03 |
I'm not going to get to this.
|
msg114450 - (view) |
Author: Daniel Stutzbach (stutzbach) |
Date: 2010-08-20 20:32 |
3.1 is long gone. Should this be addressed for 3.2?
|
msg123924 - (view) |
Author: Raymond Hettinger (rhettinger) * |
Date: 2010-12-14 03:49 |
Yes, if you have a chance to think it through, it would be nice to get this fixed-up.
|
msg123995 - (view) |
Author: Daniel Stutzbach (stutzbach) |
Date: 2010-12-15 00:55 |
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 Issue8743 is also fixed)
|
msg124239 - (view) |
Author: Daniel Stutzbach (stutzbach) |
Date: 2010-12-17 17:57 |
Raymond,
Do you have around 10 minutes today to look at the patch I submitted in Issue 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)
|
msg179871 - (view) |
Author: Ramchandra Apte (Ramchandra Apte) * |
Date: 2013-01-13 13:16 |
Bump.
|
msg189752 - (view) |
Author: Alyssa Coghlan (ncoghlan) * |
Date: 2013-05-21 13:34 |
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 issue 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.
|
msg207285 - (view) |
Author: Alyssa Coghlan (ncoghlan) * |
Date: 2014-01-04 14:03 |
Raymond, will you have a chance to look at this before 3.4rc1? Otherwise I'd like to take it.
|
msg207676 - (view) |
Author: Raymond Hettinger (rhettinger) * |
Date: 2014-01-08 06:43 |
Yes, I'll have a look shortly.
|
msg209958 - (view) |
Author: Alyssa Coghlan (ncoghlan) * |
Date: 2014-02-02 08:06 |
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 issue 8743 (where I just uploaded an up to date patch based on the patch Daniel linked to above)
|
|
Date |
User |
Action |
Args |
2022-04-11 14:56:31 | admin | set | github: 46479 |
2014-02-02 08:06:49 | ncoghlan | set | status: open -> closed superseder: set() operators don't work with collections.Set instances resolution: duplicate messages:
+ msg209958
|
2014-01-31 22:58:15 | yselivanov | set | nosy:
+ yselivanov
|
2014-01-11 16:12:57 | mark.dickinson | set | nosy:
+ mark.dickinson
|
2014-01-08 06:43:39 | rhettinger | set | messages:
+ msg207676 |
2014-01-04 14:03:35 | ncoghlan | set | messages:
+ msg207285 |
2013-11-27 09:08:42 | mdengler | set | nosy:
+ mdengler
|
2013-05-21 13:34:56 | ncoghlan | set | messages:
+ msg189752 |
2013-05-20 15:10:04 | flox | set | nosy:
+ flox
|
2013-05-20 14:29:21 | ncoghlan | set | nosy:
+ ncoghlan
|
2013-01-16 22:59:24 | stutzbach | set | assignee: stutzbach -> rhettinger |
2013-01-13 13:16:11 | Ramchandra Apte | set | nosy:
+ Ramchandra Apte messages:
+ msg179871
|
2010-12-17 17:57:19 | stutzbach | set | nosy:
barry, georg.brandl, rhettinger, benjamin.peterson, stutzbach, aronacher messages:
+ msg124239 |
2010-12-15 00:55:02 | stutzbach | set | messages:
+ msg123995 |
2010-12-14 03:49:48 | rhettinger | set | assignee: stutzbach messages:
+ msg123924 versions:
- Python 3.1 |
2010-12-14 01:14:03 | r.david.murray | set | type: behavior stage: test needed |
2010-08-20 20:32:23 | stutzbach | set | messages:
+ msg114450 |
2010-05-17 21:23:37 | pitrou | set | nosy:
+ stutzbach
versions:
+ Python 3.2 |
2009-01-06 05:03:49 | gvanrossum | set | nosy:
- gvanrossum |
2009-01-06 05:03:39 | gvanrossum | set | assignee: gvanrossum -> (no value) messages:
+ msg79229 |
2008-09-04 02:50:55 | barry | set | priority: deferred blocker -> critical messages:
+ msg72471 versions:
+ Python 3.1, - Python 2.6, Python 3.0 |
2008-09-04 02:49:28 | rhettinger | set | messages:
+ msg72469 |
2008-09-04 01:52:11 | barry | set | priority: release blocker -> deferred blocker nosy:
+ barry messages:
+ msg72454 |
2008-08-21 14:57:30 | benjamin.peterson | set | priority: critical -> release blocker |
2008-07-31 01:56:34 | benjamin.peterson | set | nosy:
+ benjamin.peterson messages:
+ msg70460 |
2008-03-18 03:04:52 | gvanrossum | set | priority: critical messages:
+ msg63861 |
2008-03-04 06:52:25 | rhettinger | set | messages:
- msg63238 |
2008-03-03 22:22:04 | rhettinger | set | assignee: rhettinger -> gvanrossum versions:
+ Python 2.6 messages:
+ msg63240 nosy:
+ gvanrossum |
2008-03-03 21:55:26 | rhettinger | set | messages:
+ msg63238 |
2008-03-03 21:26:31 | georg.brandl | set | assignee: rhettinger messages:
+ msg63233 nosy:
+ rhettinger, georg.brandl |
2008-03-03 21:24:59 | aronacher | set | messages:
+ msg63232 |
2008-03-03 21:22:10 | aronacher | create | |