Long names are doom ?

Glen Starchman glen at enabledventures.com
Sat May 26 11:35:38 EDT 2001


Rainy wrote:
> 
> On Sat, 26 May 2001 00:51:42 -0600, Andrew Dalke <dalke at acm.org> wrote:
> > Nick Perkins wrote:
> >>what if you wanted to name, say, a function
> >>with a string so that you could include spaces?
> >  ...
> >>...just a silly idea.
> >>ok, i'll go to bed now.
> >
> > Something like that came up last year, with
> > the proposed syntax of
> >
> >   obj."attribute with spaces in the name"
> >
> > As I recall, people thought it interesting, but that's
> > as far as it went.  I don't think there were any
> > definite implementation reasons against it.  But no one
> > could get a solid reason to have it, and for those
> > few cases where that functionality was needed
> >
> >   getattr(obj, "attribute with spaces in the name")
> >
> > works.
> >
> > BTW, in your proposal,
> >   fn['my special function']()
> >
> > the [] syntax could be confused with list/dict lookup.
> >
> >                     Andrew
> >                     dalke at acm.org
> 
> What's the big problem with implementing this:
> 
> my varibable = 2
> 
> my result = my variable * 3
> 
> def my function(some variable):
>     return some variable / 8
> 
> ?
> 
> I know there is something seriously wrong with this, because otherwise
> it'd be done already in some language (and afaik it isn't). So what
> exactly is wrong? I'm asking because typing up a name with underscores
> feels_awkward and separatingByCapitalLettersLooksAwkward. I can't remember
> any situation where a space is needed to separate one variable from another,
> and syntax characters aren't allowed in variable names.. 

Not with Python, but in most shell variants:

for x in $var1 $var2 $var3...

is valid.

Besides, whitespace in variable names? C'mon! That's the opposite
extreme of Fortran (older versions) with no whitespace.

If you want to prefix a variable name with 'my ', just use Perl. ;-)


What am I missing
> here? :-)
> 
> >
> >
> >
> 
> --
> Lucifer Sam Siam cat
> Always sitting by your side
> Always by your side
> That cat's something I can't explain
>         - Syd



More information about the Python-list mailing list