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

Thomas Wouters thomas@xs4all.net
Tue, 3 Apr 2001 09:09:28 +0200


On Mon, Apr 02, 2001 at 06:06:49PM -0700, Paul Prescod wrote:
> Peter Funk wrote:

> >         >>> "12345 John Doe" / "%5d %8s"
> >         (12345, 'John Doe')
> >         >>> "12 34 56 7.890" / "%d %d %d %f"
> >         (12, 34, 56, 7.8899999999999997)
> >         >>> "12345 John Doe, Foo Bar" / "%(num)d %(n)s, %(f)s %(b)s"
> >         {'n': 'John Doe', 'f': 'Foo', 'b': 'Bar', 'num': 12345}
> >         >>> "1 2" / "%d %d %d"
> >         Traceback (innermost last):
> >           File "<stdin>", line 1, in ?
> >         TypeError: not all arguments filled

> I would prefer "foo".scanf("%5d %8s") or maybe "parse" or "parseformats"
> or something like that. I know that punctuation abuse leads inexorably
> to further punctuation abuse but the cycle must stop somewhere. It's too
> late for "%" but let's save "/" while we still can!

Agreed, on both issues. We don't have 'printf', lets not use something as
inexplicable as 'scanf'!

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!