This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients ajaksu2, amaury.forgeotdarc, mwh, pitrou
Date 2011-01-04.16:24:07
SpamBayes Score 0.00035892334
Marked as misclassified No
Message-id <1294158254.12.0.805185156646.issue1075356@psf.upfronthosting.co.za>
In-reply-to
Content
It's not fixed. range() now uses the tp_index slot, in weakrefs this becomes:
    WRAP_UNARY(proxy_index, PyNumber_Index)
and indeed PyNumber_Index does not accept strings.

But try with time.sleep() instead; here the line
    WRAP_UNARY(proxy_float, PyNumber_Float)
is involved:


import _weakref, time

class U(str): pass
u = U("1")

try:
    time.sleep(u)
except TypeError:
    print("raised, good")
else:
    print("didn't raise, bad")

try:
    time.sleep(_weakref.proxy(u))
except TypeError:
    print("raised, good")
else:
    print("didn't raise, bad")
History
Date User Action Args
2011-01-04 16:24:14amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, mwh, pitrou, ajaksu2
2011-01-04 16:24:14amaury.forgeotdarcsetmessageid: <1294158254.12.0.805185156646.issue1075356@psf.upfronthosting.co.za>
2011-01-04 16:24:07amaury.forgeotdarclinkissue1075356 messages
2011-01-04 16:24:07amaury.forgeotdarccreate