Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Stephen J. Turnbull
Chris Angelico writes: Don't forget, of course, that there is a middle ground. Something that's really REALLY awesome on PyPI but isn't in the stdlib might be packaged by various Linux distros. Oh, agreed, and any organization that cares that much will already have the RHEL or Ubuntu LTS

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Paul Moore
On 28 March 2014 05:09, Josiah Carlson josiah.carl...@gmail.com wrote: So yeah. Someone want to make a decision? Tell me to write the docs, I will. Tell me to go take a long walk off a short pier, I'll thank you for your time and leave you alone. I had a need for this a few years ago. It's

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Victor Stinner
2014-03-28 2:16 GMT+01:00 Josiah Carlson josiah.carl...@gmail.com: def do_login(...): proc = subprocess.Popen(...) current = proc.recv(timeout=5) last_line = current.rstrip().rpartition('\n')[-1] if last_line.endswith('login:'): proc.send(username) if

[Python-Dev] Jython site now seems to redirect to docs.python.org???

2014-03-28 Thread Paul Moore
I'm not sure if this is a result of the recent website reorg, but www.jython.org seems to be redirecting to docs.python.org for me. Presumably this is an error - where do I report it and/or is it a known issue? Thanks, Paul. ___ Python-Dev mailing list

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Nick Coghlan
On 28 March 2014 20:20, Victor Stinner victor.stin...@gmail.com wrote: 2014-03-28 2:16 GMT+01:00 Josiah Carlson josiah.carl...@gmail.com: def do_login(...): proc = subprocess.Popen(...) current = proc.recv(timeout=5) last_line = current.rstrip().rpartition('\n')[-1] if

Re: [Python-Dev] Jython site now seems to redirect to docs.python.org???

2014-03-28 Thread Nick Coghlan
I'm not sure where the responsibilities of the redesign team end and those of the infrastructure team start, but since the switch to the new site I've been adding anything related to the website parts of python.org to https://github.com/python/pythondotorg/issues If that's not the right place,

Re: [Python-Dev] Jython site now seems to redirect to docs.python.org???

2014-03-28 Thread Paul Moore
On 28 March 2014 10:53, Nick Coghlan ncogh...@gmail.com wrote: I'm not sure where the responsibilities of the redesign team end and those of the infrastructure team start, but since the switch to the new site I've been adding anything related to the website parts of python.org to

[Python-Dev] Negative timedelta strings

2014-03-28 Thread Steven D'Aprano
There's a furious discussion going on at the python-list mailing list, about negative timedelta strings: py str(timedelta(0, -1)) '-1 day, 23:59:59' This is documented. It's even documented as being somewhat unusual. I found a tracker item for it, back in July 2010:

Re: [Python-Dev] On the necessity of PEPs [was collections.sortedtree]

2014-03-28 Thread Antoine Pitrou
On Thu, 27 Mar 2014 20:32:02 +1000 Nick Coghlan ncogh...@gmail.com wrote: Most of the time when I hear people say the PEP process is too difficult, I eventually find that what they really mean is learning the kinds of things that python-dev are likely to be worried about, and ensuring that

Re: [Python-Dev] On the necessity of PEPs [was collections.sortedtree]

2014-03-28 Thread Nick Coghlan
On 28 March 2014 21:12, Antoine Pitrou solip...@pitrou.net wrote: On Thu, 27 Mar 2014 20:32:02 +1000 Nick Coghlan ncogh...@gmail.com wrote: Most of the time when I hear people say the PEP process is too difficult, I eventually find that what they really mean is learning the kinds of things

Re: [Python-Dev] Jython site now seems to redirect to docs.python.org???

2014-03-28 Thread Donald Stufft
On Mar 28, 2014, at 6:57 AM, Paul Moore p.f.mo...@gmail.com wrote: On 28 March 2014 10:53, Nick Coghlan ncogh...@gmail.com wrote: I'm not sure where the responsibilities of the redesign team end and those of the infrastructure team start, but since the switch to the new site I've been adding

Re: [Python-Dev] Jython site now seems to redirect to docs.python.org???

2014-03-28 Thread Paul Moore
On 28 March 2014 11:24, Donald Stufft don...@stufft.io wrote: Probably infrastructure-st...@python.org OK, I've emailed them as well. Paul ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Kristján Valur Jónsson
-Original Message- From: Python-Dev [mailto:python-dev- bounces+kristjan=ccpgames@python.org] On Behalf Of Antoine Pitrou Sent: 27. mars 2014 15:53 To: python-dev@python.org Subject: Re: [Python-Dev] collections.sortedtree On Thu, 27 Mar 2014 08:50:01 -0700 Daniel Stutzbach

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/27/2014 09:16 PM, Josiah Carlson wrote: But here's the thing: I can build enough using asyncio in 30-40 lines of Python to offer something like the above API. The problem is that it really has no natural home. It uses asyncio, so makes no

[Python-Dev] libpython added to ABI tracker

2014-03-28 Thread Andrey Ponomarenko
Hi, The libpython library has been added to the ABI tracker: http://upstream-tracker.org/versions/python.html The page lists library versions and changes in API/ABI. -- Andrey Ponomarenko, NTC IT ROSA. ___ Python-Dev mailing list

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/27/2014 04:11 AM, Stephen J. Turnbull wrote: Maybe. That depends on if you care about the convenience of folks who have to get new modules past Corporate Security, but it's easier to get an upgrade of the whole shebang. I don't think it's

Re: [Python-Dev] libpython added to ABI tracker

2014-03-28 Thread Victor Stinner
Hi, 2014-03-28 9:31 GMT+01:00 Andrey Ponomarenko aponomare...@rosalab.ru: The libpython library has been added to the ABI tracker: http://upstream-tracker.org/versions/python.html The page lists library versions and changes in API/ABI. Nice! By the way, would it be possible to add a second

Re: [Python-Dev] Jython site now seems to redirect to docs.python.org???

2014-03-28 Thread Benjamin Peterson
On Fri, Mar 28, 2014, at 3:28, Paul Moore wrote: I'm not sure if this is a result of the recent website reorg, but www.jython.org seems to be redirecting to docs.python.org for me. Presumably this is an error - where do I report it and/or is it a known issue? This was my fault, though maybe

Re: [Python-Dev] Negative timedelta strings

2014-03-28 Thread Alexander Belopolsky
On Fri, Mar 28, 2014 at 7:03 AM, Steven D'Aprano st...@pearwood.info wrote: py str(timedelta(0, -1)) '-1 day, 23:59:59' .. Does anyone remember the rationale for this behaviour? I don't recall any better rationale than what I wrote in the docs: String representations of timedelta objects are

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Paul Moore
On 28 March 2014 16:22, Tres Seaver tsea...@palladion.com wrote: On 03/28/2014 12:18 PM, Tres Seaver wrote: I'm mostly arguing the FLOSS project should feel free to ignore high-maintenance-cost commercial concerns until those concerns bring either blook (funded developer time) or treasure

Re: [Python-Dev] Negative timedelta strings

2014-03-28 Thread Alexander Belopolsky
On Fri, Mar 28, 2014 at 12:19 PM, Skip Montanaro s...@pobox.com wrote: (*) As an aside (that is, this belongs in a separate thread if you want to discuss it), in my opinion, attempting to support ISO 8601 formatting is pointless without the presence of an anchor datetime. I meant ISO 8601

Re: [Python-Dev] Negative timedelta strings

2014-03-28 Thread Antoine Pitrou
On Fri, 28 Mar 2014 11:19:52 -0500 Skip Montanaro s...@pobox.com wrote: On Fri, Mar 28, 2014 at 11:07 AM, Alexander Belopolsky alexander.belopol...@gmail.com wrote: Is it open to debate or is it now cast in stone? I think the barrier for changing str() is lower than that for changing

[Python-Dev] ISO 8601 durations and datetime.timedelta

2014-03-28 Thread Skip Montanaro
Andrew wrote: I meant ISO 8601 syntax for durations [1]. That's exactly what I was referring to. Consider this session: now = datetime.datetime.now() now datetime.datetime(2014, 3, 28, 12, 4, 38, 517110) then = now - datetime.timedelta(days=57, hours=12, minutes=12, seconds=12) now

[Python-Dev] Summary of Python tracker Issues

2014-03-28 Thread Python tracker
ACTIVITY SUMMARY (2014-03-21 - 2014-03-28) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open4534 (+23) closed 28324 (+51) total 32858 (+74) Open issues

Re: [Python-Dev] Negative timedelta strings

2014-03-28 Thread Skip Montanaro
On Fri, Mar 28, 2014 at 11:07 AM, Alexander Belopolsky alexander.belopol...@gmail.com wrote: Is it open to debate or is it now cast in stone? I think the barrier for changing str() is lower than that for changing repr(), but I would be against any changes in this area. (I may have had a

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/28/2014 11:57 AM, Stephen J. Turnbull wrote: So, let me get this straight: you think that one user should pay Red Hat to vet the package for RHEL, and another user should pay to get it into Ubuntu, and another user to get it into SuSE? And

Re: [Python-Dev] ISO 8601 durations and datetime.timedelta

2014-03-28 Thread Alexander Belopolsky
On Fri, Mar 28, 2014 at 1:13 PM, Skip Montanaro s...@pobox.com wrote: Given that the timedelta has more than a month's worth of days, how would you describe it using the ISO8601 duration notation without referencing a specific point in time? Conversely, given your example, P3Y6M4DT12H30M5S,

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread R. David Murray
On Fri, 28 Mar 2014 10:45:01 -0400, Tres Seaver tsea...@palladion.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/27/2014 09:16 PM, Josiah Carlson wrote: But here's the thing: I can build enough using asyncio in 30-40 lines of Python to offer something like the above API.

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Josiah Carlson
*This* is the type of conversation that I wanted to avoid. But I'll answer your questions because I used to do exactly the same thing. On Fri, Mar 28, 2014 at 3:20 AM, Victor Stinner victor.stin...@gmail.comwrote: 2014-03-28 2:16 GMT+01:00 Josiah Carlson josiah.carl...@gmail.com: def

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Guido van Rossum
On Fri, Mar 28, 2014 at 9:45 AM, Josiah Carlson josiah.carl...@gmail.comwrote: If it makes you feel any better, I spent an hour this morning building a 2-function API for Linux and Windows, both tested, not using ctypes, and not even using any part of asyncio (the Windows bits are in msvcrt

Re: [Python-Dev] cpython: inspect.Signature: Add 'Signature.from_callable' classmethod. Closes #17373

2014-03-28 Thread Andrew Svetlov
And probably the block should be deindented On Thu, Mar 27, 2014 at 6:48 PM, Antoine Pitrou solip...@pitrou.net wrote: On Thu, 27 Mar 2014 17:12:02 +0100 (CET) yury.selivanov python-check...@python.org wrote: +.. classmethod:: Signature.from_callable(obj) + + Return a

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Stephen J. Turnbull
Tres Seaver writes: On 03/27/2014 04:11 AM, Stephen J. Turnbull wrote: Maybe. That depends on if you care about the convenience of folks who have to get new modules past Corporate Security, but it's easier to get an upgrade of the whole shebang. I don't think it's ever really

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/28/2014 12:18 PM, Tres Seaver wrote: I'm mostly arguing the FLOSS project should feel free to ignore high-maintenance-cost commercial concerns until those concerns bring either blook (funded developer time) or treasure (pooled to pay for

Re: [Python-Dev] Jython site now seems to redirect to docs.python.org???

2014-03-28 Thread Paul Moore
On 28 March 2014 13:46, Benjamin Peterson benja...@python.org wrote: This was my fault, though maybe apache 2.2's weird virtual host selection rules can share some of the blame. Fixed now. Thanks Paul ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Steven D'Aprano
On Fri, Mar 28, 2014 at 09:20:35AM +, Kristján Valur Jónsson wrote: I'll be willing to experiment with extending the heapq. methods to take an optional map argument. 'map' would be a dict, mapping objects in the heap to indices. If provided, each of the heapq methouds would take care

Re: [Python-Dev] libpython added to ABI tracker

2014-03-28 Thread Antoine Pitrou
On Fri, 28 Mar 2014 12:31:59 +0400 Andrey Ponomarenko aponomare...@rosalab.ru wrote: Hi, The libpython library has been added to the ABI tracker: http://upstream-tracker.org/versions/python.html The page lists library versions and changes in API/ABI. Thanks. Do note that most of these

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Josiah Carlson
On Fri, Mar 28, 2014 at 10:46 AM, Guido van Rossum gu...@python.org wrote: On Fri, Mar 28, 2014 at 9:45 AM, Josiah Carlson josiah.carl...@gmail.comwrote: If it makes you feel any better, I spent an hour this morning building a 2-function API for Linux and Windows, both tested, not using

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread MRAB
On 2014-03-28 16:39, Paul Moore wrote: On 28 March 2014 16:22, Tres Seaver tsea...@palladion.com wrote: On 03/28/2014 12:18 PM, Tres Seaver wrote: I'm mostly arguing the FLOSS project should feel free to ignore high-maintenance-cost commercial concerns until those concerns bring either blook

Re: [Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Request for Pronouncement

2014-03-28 Thread Georg Brandl
Am 27.03.2014 22:21, schrieb Ethan Furman: On 03/27/2014 01:44 PM, Guido van Rossum wrote: Accepted. Yay! +1 for that Yay :) Georg ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Terry Reedy
On 3/28/2014 12:45 PM, Josiah Carlson wrote: If it makes you feel any better, I spent an hour this morning building a 2-function API for Linux and Windows, both tested, not using ctypes, and not even using any part of asyncio (the Windows bits are in msvcrt and _winapi). It works in Python 3.3+.

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Josiah Carlson
On Fri, Mar 28, 2014 at 12:42 PM, Terry Reedy tjre...@udel.edu wrote: On 3/28/2014 12:45 PM, Josiah Carlson wrote: If it makes you feel any better, I spent an hour this morning building a 2-function API for Linux and Windows, both tested, not using ctypes, and not even using any part of

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Glenn Linderman
On 3/28/2014 11:35 AM, Josiah Carlson wrote: If it were me, I'd define three methods, with longer names to clarify what they do, e.g. proc.write_nonblocking(data) data = proc.read_nonblocking() data = proc.read_stderr_nonblocking() Easily doable. I'd appreciate being

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Terry Reedy
On 3/28/2014 6:20 AM, Victor Stinner wrote: Full example of asynchronous communication with a subprocess (the python interactive interpreter) using asyncio high-level API: Thank you for writing this. As I explained in response to Josiah, Idle communicates with a python interpreter subprocess

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Guido van Rossum
To be clear, the proposal for Idle would be to still use the RPC protocol, but run it over a pipe instead of a socket, right? On Fri, Mar 28, 2014 at 1:58 PM, Terry Reedy tjre...@udel.edu wrote: On 3/28/2014 6:20 AM, Victor Stinner wrote: Full example of asynchronous communication with a

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Antoine Pitrou
On Fri, 28 Mar 2014 16:58:25 -0400 Terry Reedy tjre...@udel.edu wrote: On 3/28/2014 6:20 AM, Victor Stinner wrote: Full example of asynchronous communication with a subprocess (the python interactive interpreter) using asyncio high-level API: Thank you for writing this. As I explained in

Re: [Python-Dev] Negative timedelta strings

2014-03-28 Thread Greg Ewing
Alexander Belopolsky wrote: I meant ISO 8601 syntax for durations [1]. ISO 8601 doesn't seem to define a representation for negative durations, though, so it wouldn't solve the original problem. -- Greg ___ Python-Dev mailing list

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Victor Stinner
Le 28 mars 2014 21:59, Terry Reedy tjre...@udel.edu a écrit : On 3/28/2014 6:20 AM, Victor Stinner wrote: Full example of asynchronous communication with a subprocess (the python interactive interpreter) using asyncio high-level API: However, the code below creates a subprocess for one

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Raymond Hettinger
On Mar 26, 2014, at 1:31 PM, Marko Rauhamaa ma...@pacujo.net wrote: I have made a full implementation of a balanced tree and would like to know what the process is to have it considered for inclusion in Python 3. To summarize, the implementation closely parallels dict() features and

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Josiah Carlson
If it makes you feel any better, I spent an hour this morning building a 2-function API for Linux and Windows, both tested, not using ctypes, and not even using any part of asyncio (the Windows bits are in msvcrt and _winapi). It works in Python 3.3+. You can see it here:

Re: [Python-Dev] Negative timedelta strings

2014-03-28 Thread Fred Drake
On Fri, Mar 28, 2014 at 5:19 PM, Greg Ewing greg.ew...@canterbury.ac.nz wrote: ISO 8601 doesn't seem to define a representation for negative durations, though, so it wouldn't solve the original problem. Aside from the horribleness of the ISO 8601 notation for a duration, it's best not to

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Marko Rauhamaa
Raymond Hettinger raymond.hettin...@gmail.com: * An AVL balanced tree isn't the only solution or necessarily the best solution to the problem. Tree nodes tend to take more space than denser structures and they have awful cache locality (these are the same reasons that deques use doubly-linked

Re: [Python-Dev] Negative timedelta strings

2014-03-28 Thread Marko Rauhamaa
Greg Ewing greg.ew...@canterbury.ac.nz: ISO 8601 doesn't seem to define a representation for negative durations, though, so it wouldn't solve the original problem. XSD uses ISO 8601 durations and allows a sign before the initial P. It would appear PT1M means 60 or 61 seconds. P1D means 23,

Re: [Python-Dev] Status of PEP 3145 - Asynchronous I/O for subprocess.popen

2014-03-28 Thread Richard Oudkerk
On 28/03/2014 06:35 pm, Josiah Carlson wrote: If it were me, I'd define three methods, with longer names to clarify what they do, e.g. proc.write_nonblocking(data) data = proc.read_nonblocking() data = proc.read_stderr_nonblocking() Easily doable. To implement

Re: [Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Final, Take 3

2014-03-28 Thread Ethan Furman
On 03/27/2014 04:26 AM, Nick Coghlan wrote: On 27 March 2014 20:47, Victor Stinner victor.stin...@gmail.com wrote: The PEP 461 looks good to me. It's a nice addition to Python 3.5 and the PEP is well defined. +1 from me as well. One minor request is that I don't think the rationale for

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Marko Rauhamaa
Marko Rauhamaa ma...@pacujo.net: For example, Jython would probably use SortedTree to implement it. That word just keeps coming out of my keyboard. The Java class is of course the TreeMap. Marko ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] libpython added to ABI tracker

2014-03-28 Thread Nick Coghlan
On 29 March 2014 02:25, Antoine Pitrou solip...@pitrou.net wrote: On Fri, 28 Mar 2014 12:31:59 +0400 Andrey Ponomarenko aponomare...@rosalab.ru wrote: Hi, The libpython library has been added to the ABI tracker: http://upstream-tracker.org/versions/python.html The page lists library

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Nick Coghlan
On 29 March 2014 01:57, Stephen J. Turnbull step...@xemacs.org wrote: Another way to put it is, we need a better way to fund support of routine maintenance (ie, the unfun parts) than negotiating it module by module. Yes, yes we do, and there *are* people working on that (see

[Python-Dev] Fwd: shutdown concurrent.futures.ProcessPoolExecutor

2014-03-28 Thread Giampaolo Rodola'
This is a follow up of: https://groups.google.com/forum/#!topic/python-tulip/91NCCqV4SFs According to the information I collected so far it seems it's not possible (or at least very hard) to cleanly shutdown a process pool and all its workers in case of KeyboardInterrupt / SIGINT. Literally, what

Re: [Python-Dev] collections.sortedtree

2014-03-28 Thread Dan Stromberg
On Fri, Mar 28, 2014 at 5:48 PM, Daniel Stutzbach stutzb...@google.com wrote: On Fri, Mar 28, 2014 at 2:54 PM, Marko Rauhamaa ma...@pacujo.net wrote: The blist implementation, which I have taken a quick glance at, buys cache locality at the price of block copying; I have no data to decide if