[issue19850] asyncio: limit EINTR occurrences with SA_RESTART

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: Please answer this question. Under what circumstances can a signal handler interrupt a blocking system call in a thread that is not the main thread? -- ___ Python tracker <http://bugs.python.org/issue19

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, the behavior is at least different for each type of polling system calls, and possibly also for different platforms. It would be good to describe at least all the different possible behaviors

[issue16594] SocketServer should set SO_REUSEPORT along with SO_REUSEADDR when present

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: Note: it is possible that SO_REUSEPORT is defined yet not implemented (and you'll get an OSError when using it). -- nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/is

[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: I'm not sure I understand the hesitation about backporting the Python 3 solution. We're acknowledging it's a bug, so the fix is not a feature. The Python 3 solution is the future. So why not fix it? -- ___

[issue18699] What is Future.running() for in PEP 3148 / concurrent.futures.Future?

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: I see no point in keeping this open. -- resolution: -> works for me stage: -> committed/rejected status: open -> closed type: enhancement -> behavior ___ Python tracker <http://bugs.python

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: I think we should give the reader some kind of hint, since a bug in this area may cause a lot of pain when it has to be debugged on porting from a system where the issue is silent to one where it causes a crash. These docs (unlike a PEP) are not a formal

[issue19850] asyncio: limit EINTR occurrences with SA_RESTART

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: OK, I've harassed you enough. Sorry. Go ahead and commit this. -- ___ Python tracker <http://bugs.python.org/is

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: I think you're looking for the discussion in issue 19017. IIRC the conclusion is that not only do you not get the same error everywhere, but you get it at different points -- sometimes register() of a bad FD passes and then [Selector.]select() fails,

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: Heh, I'd forgotten the behavior of unregister(). It seems that there are two layers to the behavior -- if this FD was never register()ed it will raise; if it was register()ed but has since been close()d it may raise. For the higher-level APIs in asyn

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: (What I meant to add was, I'd be happy if unregister() also just used a true/false return.) -- ___ Python tracker <http://bugs.python.org/is

[issue19827] Optimize socket.settimeout() and socket.setblocking(): avoid syscall

2013-12-03 Thread Guido van Rossum
Guido van Rossum added the comment: LGTM. I know I've written similar code in Python. :-) -- ___ Python tracker <http://bugs.python.org/issue19827> ___ ___

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-04 Thread Guido van Rossum
Guido van Rossum added the comment: I just ran into a live case of the platform differences here. Check out http://bugs.python.org/review/19509/ (issue 19509). Christian uploaded a patch for asyncio, and when I tested it I got a double traceback and a hang. This could have been avoided if

[issue19509] No SSL match_hostname() in ftp, imap, nntp, pop, smtp modules

2013-12-04 Thread Guido van Rossum
Guido van Rossum added the comment: See my messages on the review. Is it absolutely necessary to close the socket when the hostname verification fails? -- ___ Python tracker <http://bugs.python.org/issue19

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-04 Thread Guido van Rossum
Guido van Rossum added the comment: The more I think about this the more I believe unregister() should catch the OSError (but not the KeyError). Every unregister() implementation starts by calling super().unregister(key), which has a side effect (it removes the key from the _fd_to_key dict

[issue16669] Docstrings for namedtuple

2013-12-04 Thread Guido van Rossum
Guido van Rossum added the comment: I don't know if it's worth reopening this, but I had a need for generating docs including attribute docstrings for a namedtuple class using Sphinx, and I noticed a few things... (1) Regarding there not being demand: There's a StackOverflow qu

[issue16669] Docstrings for namedtuple

2013-12-04 Thread Guido van Rossum
Guido van Rossum added the comment: On Wed, Dec 4, 2013 at 5:40 PM, Terry J. Reedy wrote: > 1. I posted on SO the simple Py 3 solution that replaces the previously > posted wrapper solutions needed for Py 2. Thanks, that will give people some pointers for Python 3. We need folks to upv

[issue16669] Docstrings for namedtuple

2013-12-05 Thread Guido van Rossum
Guido van Rossum added the comment: On Wed, Dec 4, 2013 at 10:25 PM, Terry J. Reedy wrote: > I am familiar with running Sphinx on .rst files, but not on docstrings. > It looks like the docstrings use .rst markup. (Is this allowed in the > stdlib?) I'm not sure if it is allo

[issue19509] No SSL match_hostname() in ftp, imap, nntp, pop, smtp modules

2013-12-05 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks Christian, this is almost right. I'm uploading a patch that covers all bases: - Works on Python 3.3 (TEST_HOME_DIR isn't defined there) - Works on older Python 3.4 versions (check_hostname may not exist) - Works on latest Python 3

[issue19901] tests fail due to unsupported SO_REUSEPORT when building Python 3.3.2-r2

2013-12-05 Thread Guido van Rossum
Changes by Guido van Rossum : -- keywords: +easy ___ Python tracker <http://bugs.python.org/issue19901> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19842] selectors: refactor BaseSelector implementation

2013-12-05 Thread Guido van Rossum
Guido van Rossum added the comment: Well, registration is a very common pattern and you can't really require everyone to use an inferior word just because ABCMeta uses it. There's a simple work-around: abc.ABCMeta.register(selectors.BaseS

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-05 Thread Guido van Rossum
Guido van Rossum added the comment: Here's a tentative change to selectors.py that ignores the OSError in various unregister() methods (but not in register()). -- keywords: +patch Added file: http://bugs.python.org/file32999/unregister

[issue19509] No SSL match_hostname() in ftp, imap, nntp, pop, smtp modules

2013-12-05 Thread Guido van Rossum
Guido van Rossum added the comment: With the latest (revision 1605eda93392) I get four failures on OS X. Three are like this (in all three selector types -- kqueue, select, poll): == ERROR: test_create_ssl_connection

[issue16669] Docstrings for namedtuple

2013-12-05 Thread Guido van Rossum
Guido van Rossum added the comment: It was never about signature detection for me -- what gave you that idea? I simply want to have the option to put individual docstrings on the properties generated by namedtuple. -- ___ Python tracker <h

[issue19509] No SSL match_hostname() in ftp, imap, nntp, pop, smtp modules

2013-12-05 Thread Guido van Rossum
Guido van Rossum added the comment: That's fixed by revision ec1e7fc9b5a4. Christian, can this bug be closed now, or is there more? -- ___ Python tracker <http://bugs.python.org/is

[issue19842] selectors: refactor BaseSelector implementation

2013-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: This is done AFAICT. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: Ping? Charle-François, what do you think of my patch to ignore OSError in unregister()? -- assignee: docs@python -> neologix ___ Python tracker <http://bugs.python.org/issu

[issue19910] Document that compile() source may be bytes

2013-12-06 Thread Guido van Rossum
New submission from Guido van Rossum: compile() takes a string, bytes or AST as the "source" argument. The bytes option are not documented except in the error message you get when you pass something else. The AST option is in the library docs but not in the function

[issue19910] Document that compile() source may be bytes

2013-12-06 Thread Guido van Rossum
Changes by Guido van Rossum : -- keywords: +easy priority: normal -> low stage: -> needs patch ___ Python tracker <http://bugs.python.org/issue19910> ___ __

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: Here's a new patch. Note that it includes a commented-out test that demonstrates the failure if the socket object itself is closed (rather than just its FD). -- Added file: http://bugs.python.org/file33013/unregister2

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: Here's a variant that documents the ValueError issue and omits the commented-out test. -- Added file: http://bugs.python.org/file33014/unregister3.diff ___ Python tracker <http://bugs.python.org/is

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: Here's an attempt at fixing the ValueError. I don't like the exhaustive search much, but the alternative is to maintain an inverse dict. What do you think? -- Added file: http://bugs.python.org/file33015/unregi

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: OK, I'll make a new patch (maybe Monday). I want to be a little more careful with the exhaustive search, I think it should not be attempted if we see KeyError or AttributeError (those should not be dynamic). I tested for the epoll error on Ubunt

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: So I think this is why epoll doesn't raise OSError: http://hg.python.org/cpython/file/44dacafdd48a/Modules/selectmodule.c#l1335 The Python wrapper explicitly checks for EBADF and turns this into a non-error r

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: Well, I take it back. If you close the FD and then reuse it, you get ENOENT, which is not caught. So we still need the try/except OSError. I am going to experiment with a PollSelector as well. -- ___ Python

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: PollSelector doesn't seem to have this behavior. -- ___ Python tracker <http://bugs.python.org/issue19876> ___ ___ Pytho

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: New patch. Please review. The error handling is a bit complicated but I like to be careful in which errors I catch. -- Added file: http://bugs.python.org/file33020/unregister5.diff ___ Python tracker <h

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-07 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, here's another version. It keeps the original _fileobj_to_fd function and wraps it with a method that does the exhaustive search. -- Added file: http://bugs.python.org/file33025/unregister6.diff ___ P

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-07 Thread Guido van Rossum
Guido van Rossum added the comment: I think I got the closing sorted out now, and through reordering the dup2() calls are actually needed. -- Added file: http://bugs.python.org/file33028/unregister7.diff ___ Python tracker <http://bugs.python.

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-07 Thread Guido van Rossum
Guido van Rossum added the comment: OK, here's another try. I ran what you suggested for all three tests I added and they are all clean. I realized that every single call to socketpair() is followed by two addCleanup calls, so I added a make_socketpair() helper method that does

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-07 Thread Guido van Rossum
Guido van Rossum added the comment: Is this worthy of a Misc/NEWS entry? -- ___ Python tracker <http://bugs.python.org/issue19876> ___ ___ Python-bugs-list mailin

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-07 Thread Guido van Rossum
Guido van Rossum added the comment: Done. -- assignee: neologix -> gvanrossum resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> behavior ___ Python tracker <http://bugs.pyt

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-08 Thread Guido van Rossum
Guido van Rossum added the comment: I don't think we should be more selective about the errno values, the try block is narrow enough (just one syscall) and we really don't know what the kernel will do on different platforms. And what would we do about it anyway? I will look into t

[issue19876] selectors (and asyncio?): document behaviour on closed files/sockets

2013-12-08 Thread Guido van Rossum
Guido van Rossum added the comment: Then here's a hopeful fix for the Windows situation that relies on the socketpair() operation reusing FDs from the lowest value. I'm adding asserts to check that this is actually the case. (These are actual assert statements to indicate tha

[issue21163] asyncio doesn't warn if a task is destroyed during its execution

2014-06-24 Thread Guido van Rossum
Guido van Rossum added the comment: Patch looks good. Go ahead. -- nosy: +Guido.van.Rossum ___ Python tracker <http://bugs.python.org/issue21163> ___ ___ Pytho

[issue21740] doctest doesn't allow duck-typing callables

2014-06-29 Thread Guido van Rossum
Guido van Rossum added the comment: Class doctests are already supported separately, see https://docs.python.org/3/library/doctest.html#which-docstrings-are-examined -- nosy: +Guido.van.Rossum ___ Python tracker <http://bugs.python.org/issue21

[issue21777] Separate out documentation of binary sequence methods

2014-07-13 Thread Guido van Rossum
Guido van Rossum added the comment: On Sun, Jul 13, 2014 at 7:00 PM, Nick Coghlan wrote: > > Nick Coghlan added the comment: > > On 13 Jul 2014 18:39, "Marc-Andre Lemburg" wrote: > > > > > > Marc-Andre Lemburg added the comment: > > > > Why

[issue8519] doc: termios and ioctl reference links

2014-07-14 Thread Guido van Rossum
Guido van Rossum added the comment: In this case I think there is no legal issue. All you have to do is take the link from the patch and come up with a fresh patch of your own. (However I think Georg's objection against a Linux-specific link stands. You can probably find a POSIX link

[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Guido van Rossum
Guido van Rossum added the comment: I don't see the value in this complication. Please close as won't fix. -- nosy: +Guido.van.Rossum ___ Python tracker <http://bugs.python.o

[issue21988] Decrease iterating overhead in timeit

2014-07-16 Thread Guido van Rossum
Guido van Rossum added the comment: (Had to switch identities to close it.) -- resolution: -> wont fix status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue21645] asyncio: Race condition in signal handling on FreeBSD

2014-07-17 Thread Guido van Rossum
Guido van Rossum added the comment: I did my meditation. I now understand the race: - main thread is blocked in select() (or poll() etc.) - C-level signal handler is called in thread B and writes a byte to self-pipe - kernel immediately switches threads - main thread wakes up, reads data from

[issue21645] asyncio: Race condition in signal handling on FreeBSD

2014-07-17 Thread Guido van Rossum
Guido van Rossum added the comment: The more esoteric system calls you use the more you end up debugging it on esoteric platforms. :-( On Thu, Jul 17, 2014 at 9:17 AM, STINNER Victor wrote: > > STINNER Victor added the comment: > > > I don't know if it can be useful, b

[issue22006] thread module documentation erroneously(?) states not all built-in functions that do blocking I/O release the GIL

2014-07-19 Thread Guido van Rossum
Guido van Rossum added the comment: Not in my wildest dreams could I have expected that that claim would still be in the docs 20 years later. :-) Please get rid of it. -- ___ Python tracker <http://bugs.python.org/issue22

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread Guido van Rossum
Guido van Rossum added the comment: I don't know much about how sockets are implemented on Windows; is there a guarantee that the space of possible socket fds doesn't overlap the space of possible stream fds? -- ___ Python trac

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread Guido van Rossum
Guido van Rossum added the comment: Perhaps the API should take a socket object on Windows to avoid any confusion? -- ___ Python tracker <http://bugs.python.org/issue22

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread Guido van Rossum
Guido van Rossum added the comment: So perhaps an int or a socket? -- ___ Python tracker <http://bugs.python.org/issue22018> ___ ___ Python-bugs-list mailin

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread Guido van Rossum
Guido van Rossum added the comment: My worry is that somehow a program has a fd that refers to both a file and a socket. But I agree that changing the API is not a great option either. -- ___ Python tracker <http://bugs.python.org/issue22

[issue21591] "exec(a, b, c)" not the same as "exec a in b, c" in nested functions

2014-07-22 Thread Guido van Rossum
Guido van Rossum added the comment: This does appear to be a bug. Please research the C code that originates the error message -- there's probably a simple logic mistake. -- nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/is

[issue22018] Add a new signal.set_wakeup_socket() function

2014-07-24 Thread Guido van Rossum
Guido van Rossum added the comment: I find Charles' argument pretty convincing. The whole point of this API is to have another thing you can add to the selector to deal with a race condition. You then pass this thing's fileno() to signal.set_wakeup_fd(). That should be totally port

[issue22018] Add a new signal.set_wakeup_socket() function

2014-07-24 Thread Guido van Rossum
Guido van Rossum added the comment: I think if it's not a socket (or a closed one) it should raise ValueError or perhaps OSError -- TypeError would mean that it's not an int. -- ___ Python tracker <http://bugs.python.o

[issue22063] asyncio: sock_xxx() methods of event loops should make the socket non-blocking

2014-07-24 Thread Guido van Rossum
Guido van Rossum added the comment: PEP 3156 is clear: "The socket argument has to be a non-blocking socket." So it's a documentation issue. -- ___ Python tracker <http://bugs.pyt

[issue22081] Backport repr(socket.socket) from Python 3.5 to Python 2.7

2014-07-26 Thread Guido van Rossum
Guido van Rossum added the comment: Antoine, what do you want me to do? I think improving __repr__ of a socket sounds fine for some Python 2.7 bugfix release. -- ___ Python tracker <http://bugs.python.org/issue22

[issue22081] Backport repr(socket.socket) from Python 3.5 to Python 2.7

2014-07-26 Thread Guido van Rossum
Guido van Rossum added the comment: I don't think it's against policy. Do doctests even work for objects that have an address as part of their repr()? -- ___ Python tracker <http://bugs.python.o

[issue22081] Backport repr(socket.socket) from Python 3.5 to Python 2.7

2014-07-26 Thread Guido van Rossum
Guido van Rossum added the comment: OK, I'm convinced. Sorry Victor. On Saturday, July 26, 2014, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > See for example test_generators, test_genexps, test_xml_etree or > ctypes.test.test_objects. > >

[issue22087] _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-26 Thread Guido van Rossum
Guido van Rossum added the comment: Good point. Asyncio definitely should not share event loops across forked processes. However, I don't like the dependency on multiprocessing (even though it's in the stdlib) -- can't the policy just use os.getpid()? Also, I've got a fe

[issue22087] _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2014-07-26 Thread Guido van Rossum
Guido van Rossum added the comment: I think there should still be a new unittest -- we're adding a behavior we're promising, so we should test it. -- ___ Python tracker <http://bugs.python.o

[issue22089] collections.MutableSet does not provide update method

2014-07-29 Thread Guido van Rossum
Guido van Rossum added the comment: Oh the joy of duck typing. :-( If anything, set should be made to behave more like MutableSet by allowing arbitrary iterable arguments to the __i**__ methods. I do not think it is a good idea to add all of the named versions of the methods to the ABC (even

[issue22104] test_asyncio unstable in refleak mode

2014-07-29 Thread Guido van Rossum
Guido van Rossum added the comment: Was this always so or did it recently start? Victor has made a ton of changes. Anyway, I imagine there may be some objects stuck in cycles and the collection may not happen until a random later time, and the tests do timing-specific stuff so the number of

[issue17620] Python interactive console doesn't use sys.stdin for input

2014-07-30 Thread Guido van Rossum
Guido van Rossum added the comment: Is this at all related to the use of GNU readline? -- nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/issue17

[issue17620] Python interactive console doesn't use sys.stdin for input

2014-07-30 Thread Guido van Rossum
Guido van Rossum added the comment: I propose not to mess with GNU readline. But that doesn't mean we can't try to fix this issue by detecting that sys.stdin has changed and use it if it isn't referring to the original process stdin. It will be tricky however to make sure

[issue17620] Python interactive console doesn't use sys.stdin for input

2014-07-30 Thread Guido van Rossum
Guido van Rossum added the comment: sys.stdin.readline() never delegates to GNU readline. The REPL calls GNU readline directly. There's clearly some condition that determines whether to call GNU readline or sys.stdin.readline, but it may not correspond to what you want (e.g. it may

[issue22101] collections.abc.Set doesn't provide copy() method

2014-07-30 Thread Guido van Rossum
Guido van Rossum added the comment: Agreed with Raymond. The return type of copy() for ABCs feels problematic. MutableMapping doesn't have it either. -- ___ Python tracker <http://bugs.python.org/is

[issue22063] asyncio: sock_xxx() methods of event loops should check ath sockets are non-blocking

2014-07-30 Thread Guido van Rossum
Guido van Rossum added the comment: Hm. I think there are two different situations. One is where the app creates a socket (or other I/O thingie), passes it off to asyncio, and then asyncio owns it. This is the case for pipes and also for the optional sock parameter for create_connection

[issue22112] '_UnixSelectorEventLoop' object has no attribute 'create_task'

2014-07-30 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for reporting a doc bug! The code should use asyncio.async() instead of loop.create_task(). -- ___ Python tracker <http://bugs.python.org/issue22

[issue22112] '_UnixSelectorEventLoop' object has no attribute 'create_task'

2014-07-30 Thread Guido van Rossum
Guido van Rossum added the comment: I honestly don't know; ask Benjamin. :-) Personally, I'd say that ship has sailed. -- ___ Python tracker <http://bugs.python.o

[issue22112] '_UnixSelectorEventLoop' object has no attribute 'create_task'

2014-07-31 Thread Guido van Rossum
Guido van Rossum added the comment: asyncio has an explicit exemption from the general rule that bugfixes should not add new features. This is because of the "provisional" status of the PEP. We'll stop doing this once 3.5 is out. I don't know what's up with the onl

[issue22101] collections.abc.Set doesn't provide copy() method

2014-07-31 Thread Guido van Rossum
Guido van Rossum added the comment: You need to learn when to give up. :-) I wasn't the one who added a copy() method to other containers. I personally despise almost all uses of "copying" (including the entire copy module, both deep and shallow copy functionality). I much

[issue22112] '_UnixSelectorEventLoop' object has no attribute 'create_task'

2014-08-02 Thread Guido van Rossum
Guido van Rossum added the comment: Looks good! On Sat, Aug 2, 2014 at 4:19 AM, STINNER Victor wrote: > > STINNER Victor added the comment: > > Here is a a patch which replaces loop.create_task(coro) with > asyncio.async(coro), mention that asyncio.async() can be used t

[issue22192] dict_values objects are hashable

2014-08-15 Thread Guido van Rossum
Guido van Rossum added the comment: It's clear that dict.values() shouldn't be hashable -- using the identity is plain wrong here. But shouldn't the fix be to implement rich comparisons for dict.values()? I think just a a.keys() == set(a.keys()), a.values() should be =

[issue22192] dict_values objects are hashable

2014-08-15 Thread Guido van Rossum
Guido van Rossum added the comment: Oh. Yeah. Then I think there's nothing to do. -- ___ Python tracker <http://bugs.python.org/issue22192> ___ ___ Pytho

[issue21163] asyncio doesn't warn if a task is destroyed during its execution

2014-08-18 Thread Guido van Rossum
Guido van Rossum added the comment: I'm all in favor of documenting that you must keep a strong reference to a task that you want to keep alive. I'm not keen on automatically keep all tasks alive, that might exacerbate leaks (which are by definition hard to find) in existing program

[issue21163] asyncio doesn't warn if a task is destroyed during its execution

2014-08-18 Thread Guido van Rossum
Guido van Rossum added the comment: So you are changing your mind and withdrawing your option #1. I don't have the time to really dig deeply into the example app and what's going on. If you want to help, you can try to come up with a patch (and it should have good unit tests).

[issue22239] asyncio: nested event loop

2014-08-25 Thread Guido van Rossum
Guido van Rossum added the comment: While I understand your problem, I really do not want to enable recursive event loops. While they are popular in some event systems (IIRC libevent relies heavily on the concept), I have heard some strong objections from other parts, and I am trying to keep

[issue22063] asyncio: sock_xxx() methods of event loops should check ath sockets are non-blocking

2014-08-25 Thread Guido van Rossum
Guido van Rossum added the comment: LGTM -- ___ Python tracker <http://bugs.python.org/issue22063> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22279] read() vs read1() in asyncio.StreamReader documentation

2014-08-26 Thread Guido van Rossum
Guido van Rossum added the comment: Good point. I think I had forgotten how BufferedIOBase worked... :-( I believe we should just change this -- Victor, what do you think? -- ___ Python tracker <http://bugs.python.org/issue22

[issue22279] read() vs read1() in asyncio.StreamReader documentation

2014-08-26 Thread Guido van Rossum
Guido van Rossum added the comment: Oh, I just checked the docs. io.BufferedIOBase.read(size) is more complicated than I (or Jack) thought -- it can return a short read if the underlying raw stream is "interactive". The subclass io.BufferedReader uses the definition preferred by Ja

[issue22279] read() vs read1() in asyncio.StreamReader documentation

2014-08-26 Thread Guido van Rossum
Guido van Rossum added the comment: Also, I'm not too fond of the read1()/read() dichotomy. I was pretty much forced into it because Python 2 streams implemented read() using the libc fread() function, which has this behavior -- but in general I find the UNIX read() syscall more conve

[issue22279] read() vs read1() in asyncio.StreamReader documentation

2014-08-27 Thread Guido van Rossum
Guido van Rossum added the comment: Loet's just spruce up the docs a bit. (Also maybe fix that awkward sentence in the BufferedReader docs.) -- ___ Python tracker <http://bugs.python.org/is

[issue22279] read() vs read1() in asyncio.StreamReader documentation

2014-08-27 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, that too should just be documented. The read-until-eof behavior is quite entrenched (in fact I had a hard time finding example read calls with a size parameter :-). Specifying a huge buffer size in order to read until EOF isn't really a common pra

[issue21527] concurrent.futures.ThreadPoolExecutor does not use a default value

2014-08-28 Thread Guido van Rossum
Guido van Rossum added the comment: Looks good. -- nosy: +gvanrossum ___ Python tracker <http://bugs.python.org/issue21527> ___ ___ Python-bugs-list mailin

[issue22316] Add rule about "extraneous whitespace around colon" to "Whitespace In Expressions and Statements" of PEP8

2014-08-31 Thread Guido van Rossum
Guido van Rossum added the comment: Oooh, yes. The colon in a slice should be treated as a binary operator, with equal space before and after. I think we can add this (as a new bullet following the bullet "Immediately before a comma, semicolon, or colon"): - However, the colon

[issue22316] Add rule about "extraneous whitespace around colon" to "Whitespace In Expressions and Statements" of PEP8

2014-08-31 Thread Guido van Rossum
Guido van Rossum added the comment: Just like for other binary operators (except for the ones mentioned as always needing spaces), the spaces around ":" are neither mandatory nor objectionable. I am not making up a new rule, this is how I've always thought -- we just have to m

[issue22316] Add rule about "extraneous whitespace around colon" to "Whitespace In Expressions and Statements" of PEP8

2014-08-31 Thread Guido van Rossum
Guido van Rossum added the comment: Committed rev e98737176f1d. If there's more discussion I can add more. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.

[issue22316] Add rule about "extraneous whitespace around colon" to "Whitespace In Expressions and Statements" of PEP8

2014-08-31 Thread Guido van Rossum
Guido van Rossum added the comment: Does anyone care that there is now one bullet in the "avoid spaces ..." list that isn't strictly about avoiding spaces? -- ___ Python tracker <http://bugs.pyt

[issue22346] asyncio documentation does not mention provisional status

2014-09-05 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue22346> ___ ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-09-06 Thread Guido van Rossum
Guido van Rossum added the comment: - This bug should discuss doc updates, not question the rules. - The rules have evolved over time and the docs stayed behind. - We should definitely update the 2.7 docs as well as the 3.4 and 3.5 (in development) docs. The 2.7 docs need to be different

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-09-06 Thread Guido van Rossum
Guido van Rossum added the comment: That's a pretty new feature. Someone probably forgot to clean up all the places where it was documented. On Sat, Sep 6, 2014 at 4:18 PM, Martin Panter wrote: > > Martin Panter added the comment: > > The point about “a != b” deferring to “no

[issue22353] re.findall() documentation lacks information about finding THE LAST iteration of repeated capturing group (greedy)

2014-09-07 Thread Guido van Rossum
Guido van Rossum added the comment: Do you have a specific sentence or paragraph in mind that could be added? Be aware help() just shows what's in the docstring, which is typically abbreviated. The full docs are on docs.python.org. Can you find what you need there? --

[issue22253] ConfigParser does not handle files without sections

2014-09-08 Thread Guido van Rossum
Guido van Rossum added the comment: It looks like this feature request tries to change an existing (ancient) module into something it isn't. At the very least can you point to a spec for the syntax of "POSIX" config files? I always thought they were essentially shell scripts,

[issue22353] re.findall() documentation lacks information about finding THE LAST iteration of repeated capturing group (greedy)

2014-09-08 Thread Guido van Rossum
Guido van Rossum added the comment: Then let's close this issue. -- resolution: -> not a bug status: open -> closed ___ Python tracker <http://bugs.python.

[issue22412] Towards an asyncio-enabled command line

2014-09-14 Thread Guido van Rossum
Guido van Rossum added the comment: 1. Great that you're trying to implement this! 2. But I really recommend that you try to structure this as a 3rd party module first rather than patching the Python distribution -- it's much harder to get accepted. Or as a pure-Python patch

<    38   39   40   41   42   43   44   45   46   47   >