[issue16453] Inconsistent dead weakref equality

2012-11-16 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16453
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16453] Inconsistent dead weakref equality

2012-11-11 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Dead weakrefs to a given object happen to be equal if they don't have a 
callback, but unequal if they do. However, they are always equal when alive:

 class O: pass
... 
 o = O()
 def cb(_): pass
... 
 q = weakref.ref(o)
 r = weakref.ref(o)
 s = weakref.ref(o, cb)
 t = weakref.ref(o, cb)
 q == r
True
 s == t
True
 del o
 q() is None
True
 q == r
True
 s == t
False

This may be related to the following optimization (?):

 q is r
True
 s is t
False

--
components: Library (Lib)
messages: 175378
nosy: fdrake, pitrou, tim_one
priority: normal
severity: normal
status: open
title: Inconsistent dead weakref equality
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16453
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16453] Inconsistent dead weakref equality

2012-11-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Aha, it is even worse:

 o = O()
 q = weakref.ref(o)
 r = weakref.ref(o)
 del o
 q() is None
True
 q == r
True
 q != r
True

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16453
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16453] Inconsistent dead weakref equality

2012-11-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 590f1b55abea by Antoine Pitrou in branch '3.2':
Issue #16453: Fix equality testing of dead weakref objects.
http://hg.python.org/cpython/rev/590f1b55abea

New changeset c00e2c1cb3a7 by Antoine Pitrou in branch '3.3':
Issue #16453: Fix equality testing of dead weakref objects.
http://hg.python.org/cpython/rev/c00e2c1cb3a7

New changeset 9e80ea48ff39 by Antoine Pitrou in branch 'default':
Issue #16453: Fix equality testing of dead weakref objects.
http://hg.python.org/cpython/rev/9e80ea48ff39

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16453
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16453] Inconsistent dead weakref equality

2012-11-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 13b74c0b040c by Antoine Pitrou in branch '2.7':
Issue #16453: Fix equality testing of dead weakref objects.
http://hg.python.org/cpython/rev/13b74c0b040c

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16453
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16453] Inconsistent dead weakref equality

2012-11-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Now fixed.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16453
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com