[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-03-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: -590 ___ Python tracker ___ ___

[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-03-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think it is too late in the game to change the semantics of this function. Changing it now will only break code. The time for API discussion is before a release, not after. Also, we have no indication from actual users that there is an actual problem

[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-03-17 Thread Larry Hastings
Changes by Larry Hastings : -- pull_requests: +590 ___ Python tracker ___ ___

[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-01-03 Thread Xiang Zhang
Xiang Zhang added the comment: Actually this issue was discussed when import the pure Python implementation in #16694. There seems once an effort checking also the right operand but was later removed, but I couldn't understand why (though there is an explanation, but it's more about why

[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-01-03 Thread STINNER Victor
STINNER Victor added the comment: > More like a implementation detail for me. IMHO it's a deliberate choice that the operator module behaves differently for concat() and add(). -- ___ Python tracker

[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-01-03 Thread Xiang Zhang
Xiang Zhang added the comment: > You can use operator.add() if you need to fall back to a __radd__ of the > right operand. IMHO for sequences when defining __add__, __radd__, there is no difference between addition and concatenation, just as

[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think it should. You can use operator.add() if you need to fall back to a __radd__ of the right operand. operator.concat() is Python API to the sq_concat slot. It falls back to __add__() just because instances of user classes defining an __add__()

[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-01-03 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +serhiy.storchaka, zach.ware ___ Python tracker ___ ___

[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-01-03 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue29139] operator.concat/iconcat could only work if left operand is a sequence

2017-01-03 Thread Xiang Zhang
New submission from Xiang Zhang: As the title, but I think it should also continue if only the right operand is a sequence since the right operand could get a __radd__ to do the concatenation: >>> class S: ... def __init__(self): ... self.v = list(range(10)) ... def