Message260815
> the sq_length slot in the weakproxy type is set to proxy_length.
Nice. Its tp_getattro gets in the way of using __len__ directly, but this can be side stepped by manually binding the descriptor:
class Test(object):
def __len__(self):
return 2**31 + 5
>>> t = Test()
>>> p = weakref.proxy(t)
>>> p.__len__()
2147483653L
>>> type(p).__len__.__get__(p)()
-2147483643 |
|
Date |
User |
Action |
Args |
2016-02-24 15:56:58 | eryksun | set | recipients:
+ eryksun, georg.brandl, paul.moore, mark.dickinson, pitrou, vstinner, tim.golden, zach.ware, serhiy.storchaka, steve.dower, RazerM, Dave Hibbitts |
2016-02-24 15:56:58 | eryksun | set | messageid: <1456329418.81.0.588109560058.issue26423@psf.upfronthosting.co.za> |
2016-02-24 15:56:58 | eryksun | link | issue26423 messages |
2016-02-24 15:56:58 | eryksun | create | |
|