Message72151
Not bad! some remarks though:
- It's better to avoid the "expensive" call to PyErr_Occurred() when
possible. Here, an exception is set if (and only if) len==-1.
For example, it is enough to add these lines after the "__len__() should
return >= 0" message:
+ else if (PyErr_ExceptionMatches(PyExc_TypeError))
+ PyErr_SetString(PyExc_TypeError,
+ "__len__() should return an int");
- Please clarify (that is: add tests for) the case where __len__ returns
1<<50 or -1<<50. If I remember correctly, PyNumber_AsSsize_t(res, NULL)
clips the values to MAXINT. Is this wanted? |
|
Date |
User |
Action |
Args |
2008-08-29 19:28:23 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, hagen |
2008-08-29 19:28:23 | amaury.forgeotdarc | set | messageid: <1220038103.35.0.666760507285.issue3729@psf.upfronthosting.co.za> |
2008-08-29 19:28:22 | amaury.forgeotdarc | link | issue3729 messages |
2008-08-29 19:28:22 | amaury.forgeotdarc | create | |
|