proto-PEP: interpolated strings using ""if
Tim Peters
tim.one at comcast.net
Sat Feb 8 03:35:50 EST 2003
[Anthony Baxter, proposing postfix "if" as a string interpolation operator]
> Examples
>
> >>> a, b = 5, 6
> >>> print "a = $a, b = $b"if
> a = 5, b = 6
[Roman Suzi]
> What is wrong with:
>
> print "a= %(a)s, b = %(b)s" % vars()
>
> ???
It's missing "if" at the end. I'm sure Anthony will agree <wink>.
In the early 90's I was helping out on a new CPU design, and after getting
many odd proposals accepted, wrote a detailed spec for a new "sort" opcode.
It was to move all the 0 bits in a register to one end, and all the 1 bits
to the other end. An opcode modifier specified which end was which. I also
asked for another modifier, to control whether the bit sort was stable, or
whether the bits were to be swapped into place via a quicksort-like
partitioning pass. After gnashing their teeth for an hour, the HW folks
were so relieved to hear that the "stable modifier" was a joke that they
didn't even question the rest of it. Heh. Heh heh.
the-subsequent-bankruptcy-wasn't-really-related-ly y'rs - tim
More information about the Python-list
mailing list