Commonly-used names in the Python standard library

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Feb 21 07:59:41 CET 2014


On Thu, 20 Feb 2014 12:22:29 +0200, Marko Rauhamaa wrote:

> Chris Angelico <rosuav at gmail.com>:
> 
>> In working on a proposal that might result in the creation of a new
>> keyword,
> 
> I'm looking forward to the day when every application can add its own
> keywords as is customary in Lisp.

And what a wonderful day that will be! Reading any piece of code you 
didn't write yourself -- or wrote a long time ago -- will be an 
adventure! Every script will have it's own exciting new set of keywords 
doing who knows what, which makes every script nearly it's own language! 
Oh joy, I cannot wait!

That's sarcasm, by the way.


>> I needed to ascertain what names were used extensively in existing
>> Python code
> 
> One advantage of Perl is that names and keywords are in separate
> namespaces so introducing new keywords is easy.

Then I can write code like:

for for in in:
    while while:
        if if:
            raise raise

which will go a long way to ensuring that my code is an hostile and 
unreadable as possible.


(Sometimes, less can be more. That's especially true of programming 
languages.)


-- 
Steven



More information about the Python-list mailing list