[Python-Dev] PEP 292: method names

Erik Heneryd erik at heneryd.com
Mon Sep 13 18:16:08 CEST 2004


Barry Warsaw wrote:
> On Sat, 2004-09-11 at 07:54, Erik Heneryd wrote:
> 
> 
>>* 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.
> 
> 
> Noted, thanks.  In general I'm not a fan of abbreviations in APIs
> though.  Also note that it is trivial for applications to derive and
> override __mod__(), aliasing it to whichever version of substitute()
> they want.  For example, I plan on multiply inheriting Template and
> unicode, and aliasing __mod__() to safe_substitute().

-1

Well, even if it's trivial, I still think the out-of-the-box API 
shouldn't be hostile against frequent use.  Subclassing just to get a 
decent name/operator feels stupid.  Why not __mod__ = safe_substitute 
per default then?


Erik


More information about the Python-Dev mailing list