Fix a leak and a buglet discovered by Thomas.
Get rid of silly lambdas in the unit test suite.
Add a TODO list to the unit test suite (TDD style).
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 8fc089b..f221395 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -130,7 +130,7 @@
/* Get the iterator */
it = PyObject_GetIter(arg);
if (it == NULL)
- return 0;
+ return -1;
iternext = *it->ob_type->tp_iternext;
/* Run the iterator to exhaustion */
@@ -151,6 +151,7 @@
/* Interpret it as an int (__index__) */
value = PyNumber_Index(item);
+ Py_DECREF(item);
if (value == -1 && PyErr_Occurred())
goto error;