[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-29 Thread Ethan Furman
Changes by Ethan Furman : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset db7ec64aac39 by Victor Stinner in branch 'default': Issue #20284: Fix a compilation warning on Windows https://hg.python.org/cpython/rev/db7ec64aac39 -- ___ Python tracker

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-26 Thread Ethan Furman
Ethan Furman added the comment: it does seem a bit odd -- on the other hand, %s is an alias for %b, is deprecated for new 3-only code, and this might help serve as a reminder of that. Or we could fix it. ;) -- ___ Python tracker

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-26 Thread STINNER Victor
STINNER Victor added the comment: It's strange that %s format raises an error about the %b format: >>> b's? %s' % 1 Traceback (most recent call last): File "", line 1, in TypeError: %b requires bytes, or an object that implements __bytes__, not 'int' -- _

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8d802fb6ae32 by Ethan Furman in branch 'default': Issue20284: Implement PEP461 https://hg.python.org/cpython/rev/8d802fb6ae32 -- nosy: +python-dev ___ Python tracker _

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-18 Thread Ethan Furman
Ethan Furman added the comment: Thanks, Victor, for the feedback. I was able to figure out some more of the C side thanks to Georg, and I think the code is looking pretty good. There may be room for optimization by having the bytes code call the unicode implementation for more of the conversi

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-18 Thread Ethan Furman
Ethan Furman added the comment: Here's the patch -- the code for % and %= is in place for bytes and bytearray; I still need to get the doc patch done. I'll commit Wednesday-ish barring problems. Big question Background -- There is a Python C ABI function called PyBytes_

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-18 Thread STINNER Victor
STINNER Victor added the comment: I will not have to work on optimization before the alpha 1 (February 8, 2015). Ethan: just commit your patch when you consider that it's ready to be merged, we will have time to refactor and enhance the code later. IMO it's more important to have the feature in

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-17 Thread Ethan Furman
Ethan Furman added the comment: Better patch, along the lines of my original thought: - byarrayformat converts bytearray to bytes - calls bytesformat (now _PyBytes_Format) to do the heavy lifting - uses PyByteArray_FromObject to tranform back to bytearray Now working on in-place format.

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-13 Thread Ethan Furman
Ethan Furman added the comment: Removed the new ABI functions, all new functions are static. Duplicated bytes code in bytearray. in-place interpolation returns new bytearray at this point. I'll work on getting in-place working, but otherwise I'll commit this in a week so we have something in

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-12 Thread Ethan Furman
Ethan Furman added the comment: I've been digging into this over the last week and come to the realization that I won't be able to finish this patch. My apologies. Victor, can you take over? I would appreciate it. The tests I have written are only for the Python side. The patch I was workin

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-06 Thread Ethan Furman
Ethan Furman added the comment: Sorry, no. And time is scarce at the moment so figuring out server-side clones will have to wait as well. I uploaded the patch of what I have so far -- hopefully that will be helpful. Also attaching patch with just the tests. -- Added file: http://bug

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-06 Thread STINNER Victor
STINNER Victor added the comment: Ethan, do you have a public repository? If no, you can for example fork CPython: click on "Server-side clone" at https://hg.python.org/cpython/ -- ___ Python tracker __

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-06 Thread Ethan Furman
Ethan Furman added the comment: Here is what I have so far: - complete tests for bytes and bytearry (bytearray currently commented out at line 71) - pep461 implemented for bytes This is basically an adaptation of the 2.7 code for str, adjusted appropriately. I was planning on having bytea

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-06 Thread Nick Coghlan
Nick Coghlan added the comment: With the first alpha next month, unless we hear otherwise from Ethan in the next day or two, I'd suggest going ahead with the implementation. We can always tweak it during the alpha cycle if there are specific details he'd like to see changed. -- _

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-05 Thread STINNER Victor
STINNER Victor added the comment: I would be nice to share as much code as possible with the Unicode implementation. My idea was to add a "_PyBytesWriter" API, very close to the "_PyUnicodeWriter", to share code. Old patch implementing the _PyBytesWriter API: issue #17742 (rejected because it

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2015-01-05 Thread STINNER Victor
STINNER Victor added the comment: Hi. I proposed twice to Ethan to implement the PEP 461, but he replied that he wants to implement it. So, what's the status of the implementation? -- ___ Python tracker __

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-07-26 Thread Nick Coghlan
Nick Coghlan added the comment: Just noting I'm working on some significant updates to the bytes and bytearray docs in issue 21777. I'll try to get that ready for review and merged relatively soon, so the docs for this can build on top of those changes. -- nosy: +ncoghlan

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-03-27 Thread Ethan Furman
Ethan Furman added the comment: PEP 461 has been accepted. I'll look over the code soon. -- assignee: -> ethan.furman ___ Python tracker ___ ___

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-02-10 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-01-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-01-20 Thread Neil Schemenauer
Changes by Neil Schemenauer : Added file: http://bugs.python.org/file33577/04-py2-eq.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-01-20 Thread Neil Schemenauer
Changes by Neil Schemenauer : Added file: http://bugs.python.org/file33576/03-py2-flag.patch ___ Python tracker ___ ___ Python-bugs-list maili

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-01-20 Thread Neil Schemenauer
Changes by Neil Schemenauer : Added file: http://bugs.python.org/file33575/02-code-a.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue20284] patch to implement PEP 461 (%-interpolation for bytes)

2014-01-20 Thread Neil Schemenauer
Neil Schemenauer added the comment: I've updated my patch into a sequence, the first of which implements PEP 461. 02-code-a.patch adds support for %a (ascii() on arg) 03-py2-flag.patch makes %s and %r behave similar to Python 2 if a command line flag is provided to the interpreter 04-py-eq.pat