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 pitrou
Recipients benjamin.peterson, hynek, loewis, meador.inge, pitrou, python-dev, serhiy.storchaka, stutzbach
Date 2012-07-29.17:55:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343584372.3388.20.camel@localhost.localdomain>
In-reply-to <1343583917.85.0.17564324275.issue15487@psf.upfronthosting.co.za>
Content
Le dimanche 29 juillet 2012 à 17:45 +0000, Meador Inge a écrit :
> Anyway, the way you are implementing the tests has the same issue as Martin pointed
> out for the 'object.__sizeof__' method in issue15402.  I could replace the 
> 'buffered_sizeof' implementation with:
> 
>    static PyObject *
>    buffered_sizeof(buffered *self, void *unused)
>    {
>        Py_ssize_t res;
> 
>        res = 1;
>        if (self->buffer)
>            res += self->buffer_size;
>        return PyLong_FromSsize_t(res);
>    }
> 
> and the tests will still pass.

That's true but, OTOH, I don't think it's very important. First, because
it is a rather unlikely mistake. Second, because the important thing is
to check that the internal buffer is part of the returned size, which is
what Serhiy's test checks for.
History
Date User Action Args
2012-07-29 17:55:10pitrousetrecipients: + pitrou, loewis, benjamin.peterson, stutzbach, meador.inge, python-dev, hynek, serhiy.storchaka
2012-07-29 17:55:09pitroulinkissue15487 messages
2012-07-29 17:55:09pitroucreate