Message284545
> As for `operator.concat`, any reason why the check is made beforehand to see if the first argument has a `__getitem__` method?
Concatenation is an operation of sequence (+ could be used both for concatenation and addition), so you have to check __getitem__ to make sure it's a sequence.
> Couldn't that just be removed allowing the exception from `concat(1, '')` to just propagate to the caller?
If removed, `concat(1, '')` could propagate exceptions but not `concat(1, 1)`. |
|
Date |
User |
Action |
Args |
2017-01-03 09:15:09 | xiang.zhang | set | recipients:
+ xiang.zhang, ned.deily, serhiy.storchaka, Jim Fasarakis-Hilliard |
2017-01-03 09:15:09 | xiang.zhang | set | messageid: <1483434909.67.0.795957330842.issue29116@psf.upfronthosting.co.za> |
2017-01-03 09:15:09 | xiang.zhang | link | issue29116 messages |
2017-01-03 09:15:09 | xiang.zhang | create | |
|