Xiang Zhang added the comment: > 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)`. ---------- nosy: +xiang.zhang _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29116> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com