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
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