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

Benjamin Peterson bp at benjamin-peterson.org
Tue Jan 7 23:33:26 CET 2014


On Tue, Jan 7, 2014, at 12:46 PM, Barry Warsaw wrote:
> 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.

I agree. This is a very important, much-requested feature for low-level
networking code.

> 
> 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)

Yes, I don't think we need to support very much of the formatting
language cover 99.8% of formating cases for bytes.


More information about the Python-Dev mailing list