msg120743 - (view) |
Author: Tres Seaver (tseaver) * |
Date: 2010-11-08 14:12 |
Because application code which tests for the presence of
an object in a WeakSet may not be able to ensure that the
object is weak-referenceable, the set should just return
False for any object passed to '__contains__' which causes
'ref' to raise a TypeError.
Patch forthcoming.
|
msg120768 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2010-11-08 16:35 |
A result from IRC is that to be consistent with normal sets, only TypeErrors coming from ref() should be caught, but not those TypeErrors from the actual membership test (i.e. the hash functioon of the value).
|
msg120770 - (view) |
Author: Tres Seaver (tseaver) * |
Date: 2010-11-08 16:53 |
A new version of the patch, which only traps TypeErrors raises
by ref(item). The test now ensures that hashing errors are
propagated, for compatibility with standard sets.
|
msg120771 - (view) |
Author: Tres Seaver (tseaver) * |
Date: 2010-11-08 16:58 |
"One more time, with feeling."
Sorry for the noise, the last patch was not against the 2.7 trunk.
|
msg120772 - (view) |
Author: Tres Seaver (tseaver) * |
Date: 2010-11-08 17:06 |
FTR, the patch applies cleanly to the py3k branch, too. (Michael
pointed out that the original code was copied directly from there).
|
msg120774 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-11-08 17:11 |
What is the behaviour of WeakKeyDictionary here? I don't really agree that TypeError should be silenced.
|
msg120779 - (view) |
Author: Tres Seaver (tseaver) * |
Date: 2010-11-08 17:20 |
WeakKeyDictionary's __contains__:
def __contains__(self, key):
try:
wr = ref(key)
except TypeError:
return 0
return wr in self.data
|
msg122033 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2010-11-22 00:10 |
I don't have any other insights on this one. Assigned by to Antoine who appears to have put some thought into it.
|
msg122036 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-11-22 00:13 |
Well if WeakKeyDictionary silences the TypeError from ref(), it sounds consistent for WeakSet to silence it too.
|
msg123199 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2010-12-03 07:56 |
I agree; committed in r86960.
If anyone wants to change this to raise TypeError for objects that are both unhashable and unrefable, please speak up.
|
msg123249 - (view) |
Author: Tres Seaver (tseaver) * |
Date: 2010-12-03 14:19 |
This fix needs backporting to the 3.1 and 2.7 branches as well.
|
msg123252 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2010-12-03 15:20 |
Don't worry, it will be ported.
|
msg127614 - (view) |
Author: Tres Seaver (tseaver) * |
Date: 2011-01-31 16:34 |
georg.brandl (2010-12-03 10:20):
> Don't worry, it will be ported.
When? Why would it *not* be merged to the 2.7 and 3.1 branches at the
time the bug is closed? Delaying the port only increases the chance
that the fix will fall between the cracks.
In particular, I would like confirmation that the fix *will* be ported
before 2.7.2 is released: this bug causes the 2.7 Zope buildbots
to fail, which means they are disabled until the fix is released.
|
msg127615 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2011-01-31 16:42 |
Let's reopen until then.
|
msg127643 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2011-01-31 18:59 |
Because I don't think porting every change immediately is worth my time when I can do it much faster in mass-merges.
I know other developers do this differently, but since I use svnmerge to do my mass-merges, there won't be any falling through cracks.
|
msg129351 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2011-02-25 10:57 |
Backported to 3.1 in r88556, and 2.7 in r88564.
|
|
Date |
User |
Action |
Args |
2022-04-11 14:57:08 | admin | set | github: 54569 |
2011-02-25 10:57:48 | georg.brandl | set | status: open -> closed nosy:
georg.brandl, rhettinger, tseaver, pitrou, michael.foord messages:
+ msg129351
|
2011-01-31 18:59:58 | georg.brandl | set | nosy:
georg.brandl, rhettinger, tseaver, pitrou, michael.foord messages:
+ msg127643 |
2011-01-31 16:42:10 | pitrou | set | status: closed -> open
assignee: pitrou -> versions:
- Python 3.2 nosy:
georg.brandl, rhettinger, tseaver, pitrou, michael.foord messages:
+ msg127615 resolution: fixed -> accepted stage: resolved |
2011-01-31 16:34:14 | tseaver | set | nosy:
georg.brandl, rhettinger, tseaver, pitrou, michael.foord messages:
+ msg127614 |
2010-12-03 15:20:43 | georg.brandl | set | status: open -> closed
messages:
+ msg123252 |
2010-12-03 14:19:51 | tseaver | set | status: closed -> open
messages:
+ msg123249 |
2010-12-03 07:56:46 | georg.brandl | set | status: open -> closed resolution: fixed messages:
+ msg123199
|
2010-11-22 00:13:33 | pitrou | set | messages:
+ msg122036 |
2010-11-22 00:10:21 | rhettinger | set | assignee: rhettinger -> pitrou messages:
+ msg122033 |
2010-11-08 17:20:15 | tseaver | set | messages:
+ msg120779 |
2010-11-08 17:11:08 | pitrou | set | nosy:
+ pitrou
messages:
+ msg120774 versions:
+ Python 3.2 |
2010-11-08 17:07:01 | tseaver | set | versions:
+ Python 3.1 |
2010-11-08 17:06:39 | tseaver | set | messages:
+ msg120772 |
2010-11-08 16:58:25 | tseaver | set | files:
+ issue10360-redux.patch
messages:
+ msg120771 |
2010-11-08 16:57:48 | tseaver | set | files:
- issue10360-redux.patch |
2010-11-08 16:53:57 | tseaver | set | files:
+ issue10360-redux.patch
messages:
+ msg120770 |
2010-11-08 16:52:43 | tseaver | set | files:
- issue10360.patch |
2010-11-08 16:35:55 | georg.brandl | set | assignee: rhettinger
messages:
+ msg120768 nosy:
+ rhettinger, georg.brandl |
2010-11-08 16:22:46 | michael.foord | set | nosy:
+ michael.foord
|
2010-11-08 14:26:13 | tseaver | set | files:
+ issue10360.patch keywords:
+ patch components:
+ Library (Lib) |
2010-11-08 14:12:42 | tseaver | create | |