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

Stefan Behnel stefan_ml at behnel.de
Wed Jan 8 19:12:06 CET 2014


Victor Stinner, 07.01.2014 19:14:
> 2014/1/7 Stefan Behnel:
>> Victor Stinner, 06.01.2014 14:24:
>>> ``struct.pack()`` is incomplete. For example, a number cannot be
>>> formatted as decimal and it does not support padding bytes string.
>>
>> Then what about extending the struct module in a way that makes it cover
>> more use cases like these?
> 
> The idea of the PEP is to simply the portage work of Twisted and
> Mercurial developers. So the same code should work on Python 2 and
> Python 3.

Is it really a requirement that existing Py2 code must work unchanged in
Py3? Why can't someone write a third-party library that does what these
projects need, and that works in both Py2 and Py3, so that these projects
can be modified to use that library and thus get on with their porting to
Py3? Or rather one library that does what some projects need and another
one that does what other projects need, because it's quite likely that the
requirements are not really as largely identical as it seems when seen
through the old and milky Py2 glasses.

One idea of designing a Py3 was to simplify the language. Getting all Py2
"features" back in doesn't help on that path. If something can easily be
done in an external module, I think it should be done there.

Stefan




More information about the Python-Dev mailing list