[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

Barry Warsaw barry at python.org
Tue Jan 7 21:46:50 CET 2014


On Jan 07, 2014, at 10:40 AM, Georg Brandl wrote:

>Very nice, thanks.  If I was to make a blasphemous suggestion I would
>even target it for Python 3.4.  (No, seriously, this is a big issue
>- see the recent discussion by Armin - and the big names involved show
>that it is a major holdup of 3.x uptake.)  It would of course depend
>a lot on how much code from unicode formatting can be retained or
>adapted as opposed to a rewrite from scratch.

I think we should be willing to entertain breaking feature freeze for getting
this in Python 3.4.  It's a serious enough problem, and Python 3.4 will be
fairly widely distributed.  For example, it will be a supported version in the
next Debian release and in Ubuntu 14.04 LTS, and *possibly* the default Python
3 version.  However, I think we'd need to see how disruptive the code changes
are first, and get good review of any proposed patches.  Larry and Guido would
have to be on board with the exemption as well.

If adopted for Python 3.4, PEP 460 should be modest in its goals, but I think
I'd still like to see the following excluded and unknown features added:

 * Attribute access: {obj.attr}
 * Indexing: {dict[key]}
 * format keywords? b'{arg}'.format(arg=5)
 * str % dict ? b'%(arg)s' % {'arg': 5)

These are just lookup mechanisms for finding the wanted interpolation value
and don't have encoding or conversion effects.

Cheers,
-Barry


More information about the Python-Dev mailing list