[Python-ideas] [Python-ideos] Dedicated overloadable boolean operators
Random832
random832 at fastmail.com
Tue Nov 24 19:00:07 EST 2015
On 2015-11-24, Nathaniel Smith wrote:
> The semantic objection that I raised -- short circuiting means that you
> can't correctly overload 'True and numpy_array',
Well, you mean "True or" or "False and", but anyway... I've got
to confess, I don't really understand the semantic paradigm under
which it's appropriate to do this all, but it's not appropriate
for it to return True. If you can pass in True here, that implies
that the True you'll get out of this operation is an appropriate
value for using in further operations on similarly-shaped arrays.
What does it _matter_ that you get True (or 1, etc) instead of
[True, True, True, True, True, True]?
More information about the Python-ideas
mailing list