Message125337
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") |
|
Date |
User |
Action |
Args |
2011-01-04 16:24:14 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, mwh, pitrou, ajaksu2 |
2011-01-04 16:24:14 | amaury.forgeotdarc | set | messageid: <1294158254.12.0.805185156646.issue1075356@psf.upfronthosting.co.za> |
2011-01-04 16:24:07 | amaury.forgeotdarc | link | issue1075356 messages |
2011-01-04 16:24:07 | amaury.forgeotdarc | create | |
|