[New-bugs-announce] [issue2592] weakref.proxy fails to delegate tp_index slot

Nick Coghlan report at bugs.python.org
Tue Apr 8 18:17:43 CEST 2008

New submission from Nick Coghlan <ncoghlan at gmail.com>:

>From the discussion of issue 643841:

>>> class Demo:
...   def __index__(self):
...     return 1
>>> a = Demo()
>>> b = weakref.proxy(a)
>>> operator.index(a)
>>> operator.index(b)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'weakproxy' object cannot be interpreted as an index

The weakref proxy types need to be updated to delegate 2.5's new
tp_index slot.

components: Library (Lib)
messages: 65182
nosy: ncoghlan
severity: normal
status: open
title: weakref.proxy fails to delegate tp_index slot
versions: Python 2.5, Python 2.6, Python 3.0

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list