Proposal: allow '?' and '!' in identifiers

Ben Wolfson wolfson at
Wed Feb 21 16:36:35 EST 2001

In article <uwvakgkx5.fsf at>,  <piet at> wrote:
>>>>>> Joshua Marshall <jmarshal at> (JM) writes:
>JM> Christoph Horst <rc-bashar at> wrote:
>>> Nathaniel Gray <n8gray at> wrote:
>>>> IMHO it's not worth adding "!", but if "?" doesn't break anything
>then it's 
>>>> 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 mailing list