[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5 (original) (raw)
Eric V. Smith eric at trueblade.com
Fri Jan 10 23:20:32 CET 2014
- Previous message: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5
- Next message: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 1/10/2014 5:12 PM, Victor Stinner wrote:
2014/1/10 Juraj Sukop <juraj.sukop at gmail.com>:
In the case of PDF, the embedding of an image into PDF looks like:
10 0 obj << /Type /XObject_ _/Width 100_ _/Height 100_ _/Alternates 15 0 R_ _/Length 2167_ _>> stream ...binary image data... endstream endobj What not building "10 0 obj ... stream" and "endstream endobj" in Unicode and then encode to ASCII? Example: data = b''.join(( ("%d %d obj ... stream" % (10, 0)).encode('ascii'), binaryimagedata, ("endstream endobj").encode('ascii'), ))
Isn't the point of the PEP to make it easier to port 2.x code to 3.5? Is there really existing code like this in 2.x?
I think what we're trying to do is to make code that looks like: b'%d %d obj ... stream' % (10, 0) work in both 2.x and 3.5.
But correct me if I'm wrong. I'll admit to not following 100% of these emails.
Eric.
- Previous message: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5
- Next message: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]