A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-September/048816.html below:

[Python-Dev] PEP 292: method names

[Python-Dev] PEP 292: method names [Python-Dev] PEP 292: method namesErik Heneryd erik at heneryd.com
Sat Sep 11 15:04:16 CEST 2004
Erik Heneryd wrote:
> * 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...

Come to think of it, I really like the more OO-ish approach better, than 
to cram everything into a single class.  Is the safe_substitute really 
that special it deserves a special method?  Is it really the one, true 
way to do a "safe" substitution?  IIRC DOS and sh don't agree, so it's 
not that obvious.

I say keep the inheritance thing, it's much more flexible, and delegate 
the KeyError condition to an overridable method.

Erik

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4