[Python-Dev] PEP 292: method names

Erik Heneryd erik at heneryd.com
Sat Sep 11 13:54:52 CEST 2004


I haven't followed the template threads very closely, but reading the 
pep/implementation it clearly looks useful.  I don't know if I like the 
method names substitute/safe_substitute though.

* Too long
10/15 character names for something so simple it up until now just 
needed a %?  Programs using templates will probably use them 
frequently...  I'd prefer sub instead of substitute.

* Safe?
safe_substitution doesn't tell you much upon first glance.  Safe?  In 
what way?  You could even argue that the "plain" version really is the 
safer one, as you'll notice typos and thus get a more solid program.  I 
think a name hinting that this method uses the var name as a fallback 
would be better, but can't think of (a short) one...  defaultsub? 
fallbacksub?  loosesub?  Guess I could live with safe, but...


Erik



More information about the Python-Dev mailing list