[PATCH] Identifiers with '?'
mwh21 at cam.ac.uk
Tue May 23 04:59:12 EDT 2000
nospam.newton at gmx.li (Philip 'Yes, that's my address' Newton) writes:
> On 21 May 2000 20:33:07 +0100, Michael Hudson <mwh21 at cam.ac.uk> wrote:
> >Tee hee. I have on my machine built (in the last few days) a Python
> >that allows one to use identifiers containing +, *, !, ?, & and @.
> >This means you have to space your operators properly, but is IMHO
> >quite a cool mod. I can clean it up and post the patch for that if
> >anyone's interested...
> Why not add '$' to that to cater to people from the VMS (or even BASIC)
> world? SYS$LOGICAL and all that (or whatever they look like).
Easy as pie:
[mwh21 at atrus build-aug]$ ./python
Python 1.6a2 (#16, May 23 2000, 09:54:00) [GCC 2.95.2 19991024 (release)] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
Copyright 1995-2000 Corporation for National Research Initiatives (CNRI)
>>> sys$logical = 1
>>> instance? = isinstance
>>> import types
>>> $var = 1
> Or allow $ @ % to appear at the start of an identifier so more Perlers
> will be attracted to Python <wink>.
Done, but it has no effect on the meaning, so they probably still
won't be satisfied...
""">>> lots-of-ints! = range(10)
>>> for i in range(len(lots-of-ints!)):
... lots-of-ints![i] *= 4
[0, 4, 8, 12, 16, 20, 24, 28, 32, 36]"""-ly y'rs
81. In computing, turning the obvious into the useful is a living
definition of the word "frustration".
-- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html
More information about the Python-list