Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-17 Thread Ethan Furman
On 06/17/2013 09:05 PM, Eli Bendersky wrote: On Fri, Jun 14, 2013 at 6:47 AM, Serhiy Storchaka mailto:storch...@gmail.com>> wrote: 14.06.13 11:46, Antoine Pitrou написав(ла): On Fri, 14 Jun 2013 07:06:49 +0200 (CEST) raymond.hettinger mailto:python-check...@python.org>> w

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-17 Thread Eli Bendersky
On Fri, Jun 14, 2013 at 6:47 AM, Serhiy Storchaka wrote: > 14.06.13 11:46, Antoine Pitrou написав(ла): > >> On Fri, 14 Jun 2013 07:06:49 +0200 (CEST) >> raymond.hettinger wrote: >> >>> http://hg.python.org/cpython/**rev/5accb0ac8bfb >>> changeset:

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Benjamin Peterson
2013/6/17 Éric Araujo : > Le 17/06/2013 20:49, Benjamin Peterson a écrit : >> Reading Python coding cookies is outside the purview of TextIOWrapper. >> However, it would be good to have a function in the stdlib to read a >> python source file to Unicode; I've definitely implemented that >> several

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Éric Araujo
Le 17/06/2013 20:49, Benjamin Peterson a écrit : > Reading Python coding cookies is outside the purview of TextIOWrapper. > However, it would be good to have a function in the stdlib to read a > python source file to Unicode; I've definitely implemented that > several times. IIUC you want http://d

Re: [Python-Dev] cpython: Issue #3329: Add new APIs to customize memory allocators

2013-06-17 Thread Victor Stinner
2013/6/16 Antoine Pitrou : > On Sun, 16 Jun 2013 01:48:06 +0200 > Victor Stinner wrote: >> I just create the issue http://bugs.python.org/issue18227: "Use Python >> memory allocators in external libraries like zlib or OpenSSL". >> >> Is it possible to detect if Python is used as a standalone appli

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Benjamin Peterson
2013/6/17 Guido van Rossum : > On Mon, Jun 17, 2013 at 5:02 PM, Benjamin Peterson > wrote: >> 2013/6/17 Guido van Rossum : >>> On Mon, Jun 17, 2013 at 4:40 PM, Benjamin Peterson >>> wrote: >>> What exactly does the parser handles better than the io module? Is it >>> just the coding cookies? I s

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Ron Adam
On 06/17/2013 05:18 PM, Greg Ewing wrote: I'm still not convinced that this is necessary or desirable behaviour. I can understand the parser doing this as a workaround before we had universal newlines, but now that we do, I'd expect any Python string to already have newlines converted to their

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Victor Stinner
It may be possible to implement parsing the codec cookie as a Python codec :-) Victor 2013/6/18 Guido van Rossum : > On Mon, Jun 17, 2013 at 5:02 PM, Benjamin Peterson > wrote: >> 2013/6/17 Guido van Rossum : >>> On Mon, Jun 17, 2013 at 4:40 PM, Benjamin Peterson >>> wrote: 2013/6/17 Gre

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Guido van Rossum
On Mon, Jun 17, 2013 at 5:02 PM, Benjamin Peterson wrote: > 2013/6/17 Guido van Rossum : >> On Mon, Jun 17, 2013 at 4:40 PM, Benjamin Peterson >> wrote: >>> 2013/6/17 Greg Ewing : Guido van Rossum wrote: > > No. Executing a file containing those exact characters produces a > str

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Benjamin Peterson
2013/6/17 Guido van Rossum : > On Mon, Jun 17, 2013 at 4:40 PM, Benjamin Peterson > wrote: >> 2013/6/17 Greg Ewing : >>> Guido van Rossum wrote: No. Executing a file containing those exact characters produces a string containing only '\n' and exec/eval is meant to behave the same >

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Guido van Rossum
On Mon, Jun 17, 2013 at 4:40 PM, Benjamin Peterson wrote: > 2013/6/17 Greg Ewing : >> Guido van Rossum wrote: >>> >>> No. Executing a file containing those exact characters produces a >>> string containing only '\n' and exec/eval is meant to behave the same >>> way. The string may not have origina

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Benjamin Peterson
2013/6/17 Greg Ewing : > Guido van Rossum wrote: >> >> No. Executing a file containing those exact characters produces a >> string containing only '\n' and exec/eval is meant to behave the same >> way. The string may not have originated from a file, so the universal >> newlines behavior of the io m

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Guido van Rossum
On Mon, Jun 17, 2013 at 3:18 PM, Greg Ewing wrote: > Guido van Rossum wrote: >> >> No. Executing a file containing those exact characters produces a >> string containing only '\n' and exec/eval is meant to behave the same >> way. The string may not have originated from a file, so the universal >>

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Greg Ewing
Guido van Rossum wrote: No. Executing a file containing those exact characters produces a string containing only '\n' and exec/eval is meant to behave the same way. The string may not have originated from a file, so the universal newlines behavior of the io module is irrelevant here -- the parser

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Ron Adam
On 06/17/2013 12:04 PM, Walter Dörwald wrote: Making the string raw, of course turns it into: U+0027: APOSTROPHE U+0027: APOSTROPHE U+0027: APOSTROPHE U+005C: REVERSE SOLIDUS U+0072: LATIN SMALL LETTER R U+005C: REVERSE SOLIDUS U+006E: LATIN SMALL LETTER N U+002

Re: [Python-Dev] Problem with pydoc script in PEP 405 venvs

2013-06-17 Thread Vinay Sajip
Oleg Broytman phdru.name> writes: > > On Mon, Jun 17, 2013 at 06:37:49PM +, Vinay Sajip yahoo.co.uk> wrote: > > echo off > > __VENV_PYTHON__ -c "import sys, pydoc; sys.exit(pydoc.cli())" > >I think you want to pass command line arguments: > > echo off > __VENV_PYTHON__ -c "import

Re: [Python-Dev] Problem with pydoc script in PEP 405 venvs

2013-06-17 Thread Oleg Broytman
On Mon, Jun 17, 2013 at 06:37:49PM +, Vinay Sajip wrote: > @echo off > __VENV_PYTHON__ -c "import sys, pydoc; sys.exit(pydoc.cli())" I think you want to pass command line arguments: @echo off __VENV_PYTHON__ -c "import sys, pydoc; sys.exit(pydoc.cli())" %1 %2 %3 %4 %5 %6 %7 %8 %9 Oleg.

Re: [Python-Dev] Problem with pydoc script in PEP 405 venvs

2013-06-17 Thread R. David Murray
On Mon, 17 Jun 2013 16:27:45 -, Vinay Sajip wrote: > Issue #18224 (http://bugs.python.org/issue18224) highlights a problem on > Windows with the pydoc script provided with venvs created by pyvenv. On > POSIX, the script is named pydoc and causes no problems: on Windows, it is > called pydoc.py

Re: [Python-Dev] Problem with pydoc script in PEP 405 venvs

2013-06-17 Thread Vinay Sajip
Richard Oudkerk gmail.com> writes: > > Can't a batch file pydoc.bat be used? > I generally find .bat files so limiting that I never thought of that. In this case, it makes perfect sense to use one. Thanks! @echo off __VENV_PYTHON__ -c "import sys, pydoc; sys.exit(pydoc.cli())" should do it.

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Guido van Rossum
On Mon, Jun 17, 2013 at 10:04 AM, Walter Dörwald wrote: > I expected that eval()ing a string that contains the characters > >U+0027: APOSTROPHE >U+0027: APOSTROPHE >U+0027: APOSTROPHE >U+000D: CR >U+000A: LR >U+0027: APOSTROPHE >U+0027: APOSTROPHE >U+0027: APOSTROPH

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Walter Dörwald
On 17.06.13 19:04, Walter Dörwald wrote: Hmm, it seems that codecs.unicode_escape_decode() does what I want: >>> codecs.unicode_escape_decode("\r\n\\r\\n\\x0d\\x0a\\u000d\\u000a") ('\r\n\r\n\r\n\r\n', 26) Hmm, no it doesn't: >>> codecs.unicode_escape_decode("\u1234") ('á\x88´', 3) Servus,

Re: [Python-Dev] Writing Extensions for Python 3 in Windows

2013-06-17 Thread Brett Cannon
So the best place to ask this question is python-list and not python-dev as this is about developing *for* Python and not *with* Python. On Mon, Jun 17, 2013 at 12:42 PM, Aditya Avinash wrote: > Hi. This is the last place where I want to ask a question. I have searched > for lots of tutorials a

Re: [Python-Dev] Problem with pydoc script in PEP 405 venvs

2013-06-17 Thread Richard Oudkerk
On 17/06/2013 5:27pm, Vinay Sajip wrote: 3. Rename the pydoc.py script to pydoc-script.py and introduce a simple .exe launcher pydoc.exe adjacent to it (which is how setuptools and distlib handle installed scripts). Can't a batch file pydoc.bat be used? -- Richard

Re: [Python-Dev] eval and triple quoted strings

2013-06-17 Thread Walter Dörwald
On 14.06.13 23:03, PJ Eby wrote: On Fri, Jun 14, 2013 at 2:11 PM, Ron Adam wrote: On 06/14/2013 10:36 AM, Guido van Rossum wrote: Not a bug. The same is done for file input -- CRLF is changed to LF before tokenizing. Should this be the same? python3 -c 'print(bytes("""\r\n""", "utf8")

[Python-Dev] Writing Extensions for Python 3 in Windows

2013-06-17 Thread Aditya Avinash
Hi. This is the last place where I want to ask a question. I have searched for lots of tutorials and documentation on the web but, didn't find a decent one to develop extensions for Python 3 using a custom compiler (mingw32, nvcc). Please help me. PS: Don't point me to Python Documentation. It is n

[Python-Dev] Problem with pydoc script in PEP 405 venvs

2013-06-17 Thread Vinay Sajip
Issue #18224 (http://bugs.python.org/issue18224) highlights a problem on Windows with the pydoc script provided with venvs created by pyvenv. On POSIX, the script is named pydoc and causes no problems: on Windows, it is called pydoc.py and this causes problems because it shadows the stdlib pydoc mo