Hi Neil
I'm an amateur (unpaid) research mathematician. I find the syntax
>>> A in B < C
clear. And in some cases appropriate to use. Although I don't like the
choice of identifiers. Mathematicians usually use upper-case letters for
set, and lower-case letters for their elements.
Thus I prefer
>>> a in B < C
which in now clearer. And if
>>> A = {a}
then equivalently we have
>>> A < B < C
I agree with Chris, this sort of thing is better done using a linter.
That's how the gotcha
>>> def wibble(lst=[])
>>> # do something with lst
>>> return lst
is detected.
Finally, when an expression such as
>>> a in B < C
I'd expect B to one of the variables being looped over (otherwise there's
invariant code that can be move outside the loop.
Thank you, Neil, for your interesting question. I don't doubt that some
people find
>>> A in B < C
confusing. Although there may be a problem to be solve here, I think making
it a syntax error is disproportionate. Perhaps you could find a more
focused solution.
--
Jonathan
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/NAMXXWYDVL5CLHHKNEMJ57NF33JTQQS4/
Code of Conduct: http://python.org/psf/codeofconduct/