Message162457
| Author |
Julian |
| Recipients |
Julian |
| Date |
2012年06月07日.05:23:11 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1339046592.67.0.693988189804.issue15023@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The following code raises an unexpected exception:
class Foo(object):
def __len__(self):
raise Exception()
def __iter__(self):
return iter([])
list(Foo())
In the optimizations being done in listextend, it appears len is getting called first for some reason (sorry, haven't gotten a chance to step through it carefully yet).
Tangentially, PyPy (correctly I guess) throws no such exception. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年06月07日 05:23:12 | Julian | set | recipients:
+ Julian |
| 2012年06月07日 05:23:12 | Julian | set | messageid: <1339046592.67.0.693988189804.issue15023@psf.upfronthosting.co.za> |
| 2012年06月07日 05:23:11 | Julian | link | issue15023 messages |
| 2012年06月07日 05:23:11 | Julian | create |
|