Are Python's reserved words reserved in places they dont need tobe?

Jason tenax.raccoon at gmail.com
Thu Sep 14 12:17:29 EDT 2006


Antoon Pardon wrote:
> On 2006-09-14, Steven D'Aprano <steve at REMOVEME.cybersource.com.au> wrote:
> > On Wed, 13 Sep 2006 07:45:02 +0000, Antoon Pardon wrote:
> >
> >>>> This is just an idea of mine, nothing I expect python to adapt.
> >>>> But just suppose the language allowed for words in bold. A word
> >>>> in bold would be considered a reserved word, a word in non bold
> >>>> would be an identifier.
> >
> > But surely all you are doing is changing the reserved word from (say)
> > "return" to "\x0breturn". Once you do that, you can bet that people will
> > complain that they want to have identifiers in bold too, why can't they
> > create a name "\x0breturn", and somebody will come up with an even more
> > complicated scheme for accommodating them... wash, rinse, repeat.
>
> Do you really think this is a serious possibility? As far as I can see,
> that \x0b that will be prepended to differentiate keywords from
> identifiers is a technique called stropping, that has been used with
> some algol languages. Have you any knowledge of people programming algol
> who asked for the use of stropped identifiers?
>
> I think I really would be amazed to find out there were such people,
> but then I have been amazed before. So I really would like to know.

Don't restrict yourself to something like that!  Use HTML to indicate
purpose of your python programs!  So, your identifiers must be between
<b> and </b> tags.  You strings will have to sit inside of a CDATA
section to work right, and you get all sorts of entity substitutions
for free!

"My program doesn't work anymore."
"Are your function names between h3 tags?"

(Secretly repulsed, yet fascinated....)
    --Jason




More information about the Python-list mailing list