[Python-3000-checkins] r45652 - in python/branches/p3yk: Include/Python.h Include/bytesobject.h Lib/test/test_bytes.py Makefile.pre.in Objects/bytesobject.c Objects/object.c Python/bltinmodule.c

Thomas Wouters thomas at python.org
Sun Apr 23 02:25:53 CEST 2006


Yay, progress :)

On 4/23/06, guido.van.rossum <python-3000-checkins at python.org> wrote:

> Here is a bytes type.  It's very minimal but it's a start.


It's a bit leaky, and I noticed a teensy buglet. Are you still working on
it, or should I just check in fixes?

+    /* Get the iterator */
> +    it = PyObject_GetIter(arg);
> +    if (it == NULL)
> +       return 0;


Shouldn't this return -1?


>
> +    /* Run the iterator to exhaustion */
> +    for (;;) {
> +       PyObject *item;
> +       Py_ssize_t value;
> +
> +       /* Get the next item */
> +       item = iternext(it);


You never DECREF the item the iterator gives you.

(There was also a typo in the testsuite that only showed when running under
regrtest, I checked that in already.)

--
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000-checkins/attachments/20060423/d76a4e8e/attachment.html 


More information about the Python-3000-checkins mailing list