Pre-PEP: Refusing to guess in string formatting operations

Jp Calderone exarkun at intarweb.us
Tue Mar 11 21:17:31 EST 2003


On Tue, Mar 11, 2003 at 09:43:58PM +0200, Beni Cherniavsky wrote:
> Here is something I cooked a week ago but managed to post only now
> because it was buried in a damaged disk :-).  Please comment on it.
> 
> Also availiable on
> 
> http://www.technion.ac.il/~cben/python/pep-strfmt.txt
> http://www.technion.ac.il/~cben/python/pep-strfmt.html
> 

  Regarding the second part of the PEP,

    http://sourceforge.net/tracker/index.php?func=detail&aid=639307&group_id=5470&atid=305470  

  In retrospect, I would rather have the method named __mod__.  It is the
only thing that -really- makes sense, and it clears up two related warts:
using the % operator on strings calls no function reachable from Python, and
subclasses of str cannot override the % behavior.

  Jp

> [snip PEP]

-- 
"One World, one Web, one Program." - Microsoft(R) promotional ad
"Ein Volk, ein Reich, ein Fuhrer." - Adolf Hitler
-- 
 up 8 days, 13:59, 12 users, load average: 0.12, 0.05, 0.04





More information about the Python-list mailing list