Author eryksun
Recipients Dave Hibbitts, RazerM, eryksun, georg.brandl, mark.dickinson, paul.moore, pitrou, serhiy.storchaka, steve.dower, tim.golden, vstinner, zach.ware
Date 2016-02-24.15:56:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1456329418.81.0.588109560058.issue26423@psf.upfronthosting.co.za>
In-reply-to
Content
> 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
History
Date User Action Args
2016-02-24 15:56:58eryksunsetrecipients: + 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:58eryksunsetmessageid: <1456329418.81.0.588109560058.issue26423@psf.upfronthosting.co.za>
2016-02-24 15:56:58eryksunlinkissue26423 messages
2016-02-24 15:56:58eryksuncreate