Question mark in variable and function names

Alex Martelli aleaxit at yahoo.com
Wed Oct 6 15:28:44 EDT 2004


Fernando Perez <fperez528 at yahoo.com> wrote:
   ...
> precedent for !cmd meaning 'escape to shell' in several environments (gnuplot,
> matlab), and for foo? as 'info about foo' (Mathematica), I hope I'd have a
> stronger case of opposing these changes if they ever came to Guido.  

What about a compromise: allow ! and ? only as the LAST (and NOT only)
character of an identifier.  This leaves you the !cmd as escape to
shell, and you only need to ask users to leave a space before the
question mark (as in 'x ?') when they're questing for info about x (or
you could switch to ?x -- whatever...).

> But if something like this (!?) were to be seriously considered, I would most
> definitely try to oppose it.  Granted, my opinion is just one amongst many.
> But the fact that ipython is proving to be a growingly popular tool for
> interactive work in multiple contexts, and that this popularity is in no small
> part due precisely to the utility of features like !cmd and foo?, would
> hopefully give my humble opinion the weight of a larger community.

I love iPython, but the (hypothetical) moment iPython or any other tool
starts holding back the development of the _language_ is the moment I
turn into a deadly enemy of the tool in question, _whatever_ it may be.
We have enough tails-wagging-dogs in the real world, we don't need more
of that in the fairytale world of the Snake...!-)

> That, and the fact that in _my_ opinion, names-with-embedded-punctuation look
> ugly :)

Embedded, yes, trailing, no -- that's the compromise I'm proposing... no
'foo!bar' or 'fee?fie' identifier, just _trailing_ bangs and qmarks...


Alex



More information about the Python-list mailing list