switch recipe?

Sean 'Shaleh' Perry shalehperry at attbi.com
Fri Jul 12 16:17:06 EDT 2002


> 
> I appreciate your opinion and I mean and say this with respect:  One of the
> joys of Python is that even supposedly advanced tricks are eminently
> explorable.  I would rather not patronize someone and I'd rather make the
> mistake of offering them too much than too little.  Besides, even if they
> can't get it, they're not the only ones reading this list now or in the
> future.    Ultimately, I can trace this sentiment back to something very
> personal:  That's precisely how I'd want to be treated.  Wouldn't you?
> 
> I mean, it's not like I vomitted some obscurified black hole of
> context-laden punctuation (i.e., Perl) on them.  <wink>
> 

the template variable ......

>> Plus one letter variable names are a pain.
> 
> I go back and forth on this one.  Presumably, you don't mean for counters
> and the like (e.g., i, n).  I tend to use one-letter variable names when
> locals() is very small, the function is short (e.g., 5-10 lines) and the
> meaning is painfully obvious.  Perhaps a bad habit?  E.g., s, imho, is
> better than text or string for a string.  I'm not trying to save typing, so
> much.  I strive for clarity of intent at the level of module, class,
> function names.  So that I don't feel so bad using one-letter variable
> names.  But, reasonable people disagree and I enjoy seeing alternative
> styles, discussing them.
> 

I always seem to have a semi violent reaction when I see locals().





More information about the Python-list mailing list