[Python-Dev] s1 == (sf % (s1 / sf))? A bad idea?

Guido van Rossum guido@digicool.com
Tue, 03 Apr 2001 07:12:50 -0500


> > Peter, if you can do a prototype implementation (in Python would be
> > best), the idea might be received better.
> 
> I believe a strawman derived from the UserString class could be done
> in pure Python.  But I'm sorry: I've no time for this during April.

Oh well, maybe someone else will like the idea.

> I'm also not sure, whether this is really a worthwile effort and whether
> I should champion this idea further.  From Pauls response I got the
> impression that people already consider the '%' string interpolation
> operator as a language wart rather than an elegant feature.

Well, that was one response.  Besides, it's easy to factor out two
separate design decisions: (1) a string scanning mechanism that takes
two strings (a format and an input string) and returns one or more
values extracted from the input string according to the rules set by
the format string, and (2) how to spell this: scanf(format, input) or
format/input or input/format or whatever.

> I however often like the infix notation better.  

See my two examples above for a concern: already I cannot recall
whether your PEP proposes format/input or input/format.  That's a bad
sign for either spelling. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)