[Python-3000] print() parameters in py3k
Barry Warsaw
barry at python.org
Mon Nov 20 20:11:34 CET 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Nov 20, 2006, at 12:14 PM, Josiah Carlson wrote:
> How much print statement rewriting do you want to do? Me, I'd like to
> get away with as little as possible. Adding parenthesis isn't that
> bad.
> Changing everything to use a printf-style would be 1) annoying, 2)
> unnecessary, and 3) I hate printf.
Are we going to include a flawless transformation script for Python
3k? If not, then I'm pretty much resigned to rewriting them by hand
anyway.
But I think this would be solved by adopting separate print() and
printf() thingies.
>> There are lots of questions to answer, such as whether to use $-
>> strings and require keyword arguments.
>
> Bad idea. Unless we are changing all of string formatting to use $,
> then changing the default string formatting of one of the likely most
> used functions, is at best confusing, and certainly gratuitous
> breakage.
> Then again, I never saw that using required parens and a specifier
> like
> %(...)s was a burden...
I withdraw the suggestion to use $-strings in the format string. If
we get printf, it should only use PEP 3101 format strings. I still
believe that $-strings will be useful because they target a different
audience. The motivating use case for PEP 292 was that translators
are not (always) programmers. Programmers can handle %()s
substitutions or PEP 3101 format strings, but translators have lots
of problems with them. It makes sense to keep the uber-powerful PEP
3101 format strings for programmers and simple PEP 292 strings for
non-programmers.
- -Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iQCVAwUBRWH953EjvBPtnXfVAQIA2QQAtSF0djvOIJQCUegtifmIn3w+SG6epykC
BDL6mI0T7TbSKyQLQxgKBkqTzGnJCcCa4eWRi0ATOZyPMTU8YmZBB70SLzLOMaqT
LAYl77i+PCRxO6DCS2PQuCltv1LuMi6x36KtJ4BM0sMXDK51f/uykz6z8F+qfQpO
Okt98c0EiqY=
=eYRm
-----END PGP SIGNATURE-----
More information about the Python-3000
mailing list