Proposal: allow '?' and '!' in identifiers
wolfson at midway.uchicago.edu
Wed Feb 21 22:36:35 CET 2001
In article <uwvakgkx5.fsf at cs.uu.nl>, <piet at cs.uu.nl> wrote:
>>>>>> Joshua Marshall <jmarshal at mathworks.com> (JM) writes:
>JM> Christoph Horst <rc-bashar at gmx.net> wrote:
>>> Nathaniel Gray <n8gray at caltech.edu.is.my.email.address> wrote:
>>>> IMHO it's not worth adding "!", but if "?" doesn't break anything
>>>> a net gain. I assert that it _would_ make Python more expressive
>to add an
>>>> elegant way of indicating that a function returns only boolean values.
>>> What's wrong with prefixing the function name with 'is'?
>JM> I wouldn't say anything is wrong with that approach. But then I could
>JM> also ask "Why do we need underscores as valid identifier characters?
>JM> You can just capitalize the next letter."
>JM> The question mark is an unused character, and carries some
>JM> natural-language meaning. It's useful.
>Please don't do it. There are more useful things to do with ? like the
>ternary operator for conditional expressions.
Python isn't heading this way, but it's possible to allow a ? in
identifiers and still have it be an operator, by mandating that
operators have whitespace on both sides.
Barnabas T. Rumjuggler
For the world, I count it not an inn, but an hospital; and a place not to
live, but to die in.
-- Thomas Browne, _Religio Medici_
More information about the Python-list