[issue34841] Script’s directory not in sys.path with embeddable Windows distribution

2018-09-29 Thread Simon Sapin
Simon Sapin added the comment: Removing python37._pth restores the documented behavior, I don’t know if it has adverse effects. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34841] Script’s directory not in sys.path with embeddable Windows distribution

2018-09-29 Thread Simon Sapin
New submission from Simon Sapin : https://docs.python.org/3/library/sys.html#sys.path documents: > As initialized upon program startup, the first item of this list, path[0], is > the directory containing the script that was used to invoke the Python > interpreter. On Window

[issue33698] `._pth` does not allow to populate `sys.path` with empty entry

2018-09-29 Thread Simon Sapin
Change by Simon Sapin : -- nosy: +ssapin ___ Python tracker <https://bugs.python.org/issue33698> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20007] .read(0) on http.client.HTTPResponse drops the rest of the content

2013-12-17 Thread Simon Sapin
Simon Sapin added the comment: I could reproduce on 3.3.3 and tip, but not 3.2.3 or 2.7.6. -- versions: +Python 3.5 -Python 2.7 ___ Python tracker <http://bugs.python.org/issue20

[issue20007] .read(0) on http.client.HTTPResponse drops the rest of the content

2013-12-17 Thread Simon Sapin
Simon Sapin added the comment: html5lib issue: https://github.com/html5lib/html5lib-python/issues/127 -- ___ Python tracker <http://bugs.python.org/issue20

[issue20007] .read(0) on http.client.HTTPResponse drops the rest of the content

2013-12-17 Thread Simon Sapin
Simon Sapin added the comment: Adding a proposed patch. -- keywords: +patch Added file: http://bugs.python.org/file33179/python-issue20007.diff ___ Python tracker <http://bugs.python.org/issue20

[issue20007] .read(0) on http.client.HTTPResponse drops the rest of the content

2013-12-17 Thread Simon Sapin
New submission from Simon Sapin: When given a file-like object, html5lib calls .read(0) in order to check if the result is bytes or Unicode: https://github.com/html5lib/html5lib-python/blob/e269a2fd0aafcd83af7cf1e65bba65c0e5a2c18b/html5lib/inputstream.py#L434 When given the result of

[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-08-13 Thread Simon Sapin
Simon Sapin added the comment: I just remembered about this. I suppose it is too late for 3.3? -- ___ Python tracker <http://bugs.python.org/issue13742> ___ ___

[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-01-16 Thread Simon Sapin
Simon Sapin added the comment: heapq_merge_key_duplicate.patch is a new patch with two code path. It also updates the function’s docstring (which the previous patch did not). Raymond, do you think the speed is worth the DRY violation? -- Added file: http://bugs.python.org/file24248

[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-01-09 Thread Simon Sapin
Simon Sapin added the comment: Raymond, please have a look at merge_3 in benchmark_heapq_merge.py. It is implemented as you say. Do you think the speed is worth the code duplication? -- ___ Python tracker <http://bugs.python.org/issue13

[issue5441] Convenience API for timeit.main

2012-01-09 Thread Simon Sapin
Changes by Simon Sapin : -- nosy: +ssapin ___ Python tracker <http://bugs.python.org/issue5441> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-01-09 Thread Simon Sapin
Simon Sapin added the comment: Oops, the patch to the documentation would also need 'New in 3.3: the key parameter', with the right Sphinx directive. But that depends on whether this change ends up in 3.3 or 3.4. Does 3.3 still get ne

[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-01-09 Thread Simon Sapin
Simon Sapin added the comment: The attached script benchmarks the basline (current implementation) against 3 new implementations, as suggested on http://mail.python.org/pipermail/python-ideas/2012-January/013296.html On my machine, the output is: merge_baseline per run, min of 3

[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-01-09 Thread Simon Sapin
New submission from Simon Sapin : Hi, The attached patch adds a 'key' optional parameter to the heapq.merge function that behaves as in sorted(). Related discussion: http://mail.python.org/pipermail/python-ideas/2012-January/013295.html This is my first contribution