On Fri, Jun 12, 2020 at 12:56 PM Eric Wieser <wieser.eric+nu...@gmail.com>
wrote:

> >  But how would you invoke them, other than using operator.add and
> operator.concat?
>
> The case I was thinking of was just a direct call to `operator.concat`.
> The motivation here is simply to make `operator.concat` do
> something non-surprising on numpy arrays (be that `np.concatenate(a, b)`,
> or simply `raise TypeError`).
> I doubt numpy would actually advocate using it, but we can at least remove
> the foot-gun.
>

Oh, that makes sense, as a CPython specific behavior. What does it do
currently? Is the problem that it does the same thing as add? I'd vote for
raising -- you shouldn't encourage or enable code that uses this pattern.
(In general I am a big fan of just never using the operator module.)

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/4OBAZMPYMK6GW2ORCUCKLA3AK7P56UZU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to