[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-11-17 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +22251
pull_request: https://github.com/python/cpython/pull/23358

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42366] Use MSVC2019 and /Ob3 option to compile Windows builds

2020-11-17 Thread Christian Heimes


Christian Heimes  added the comment:

Thank you for your thorough testing. It's useful to know that the option does 
not speed up PGO builds of Python.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42366] Use MSVC2019 and /Ob3 option to compile Windows builds

2020-11-17 Thread Ma Lin


Ma Lin  added the comment:

Last benchmark was wrong, \Ob3 option was not enabled.

Apply `pgo_ob3.diff`, it slows, so I close this issue.

+-++--+
| Benchmark   | py39_pgo_a | py39_pgo_b   |
+=++==+
| 2to3| 461 ms | 465 ms: 1.01x slower (+1%)   |
+-++--+
| chameleon   | 13.4 ms| 13.7 ms: 1.03x slower (+3%)  |
+-++--+
| chaos   | 138 ms | 141 ms: 1.02x slower (+2%)   |
+-++--+
| crypto_pyaes| 141 ms | 143 ms: 1.01x slower (+1%)   |
+-++--+
| deltablue   | 9.01 ms| 9.20 ms: 1.02x slower (+2%)  |
+-++--+
| django_template | 64.7 ms| 65.4 ms: 1.01x slower (+1%)  |
+-++--+
| dulwich_log | 78.2 ms| 78.8 ms: 1.01x slower (+1%)  |
+-++--+
| fannkuch| 640 ms | 668 ms: 1.04x slower (+4%)   |
+-++--+
| float   | 165 ms | 163 ms: 1.01x faster (-1%)   |
+-++--+
| genshi_text | 40.7 ms| 41.5 ms: 1.02x slower (+2%)  |
+-++--+
| genshi_xml  | 87.2 ms| 88.4 ms: 1.01x slower (+1%)  |
+-++--+
| go  | 309 ms | 314 ms: 1.01x slower (+1%)   |
+-++--+
| hexiom  | 12.3 ms| 12.7 ms: 1.03x slower (+3%)  |
+-++--+
| json_dumps  | 16.7 ms| 16.8 ms: 1.01x slower (+1%)  |
+-++--+
| json_loads  | 32.1 us| 32.5 us: 1.01x slower (+1%)  |
+-++--+
| logging_format  | 14.6 us| 15.0 us: 1.03x slower (+3%)  |
+-++--+
| logging_silent  | 247 ns | 257 ns: 1.04x slower (+4%)   |
+-++--+
| logging_simple  | 13.2 us| 13.6 us: 1.03x slower (+3%)  |
+-++--+
| mako| 22.1 ms| 22.8 ms: 1.03x slower (+3%)  |
+-++--+
| meteor_contest  | 135 ms | 137 ms: 1.01x slower (+1%)   |
+-++--+
| nbody   | 184 ms | 191 ms: 1.04x slower (+4%)   |
+-++--+
| nqueens | 132 ms | 137 ms: 1.04x slower (+4%)   |
+-++--+
| pathlib | 156 ms | 162 ms: 1.04x slower (+4%)   |
+-++--+
| pickle  | 16.3 us| 15.4 us: 1.05x faster (-5%)  |
+-++--+
| pickle_dict | 39.7 us| 40.0 us: 1.01x slower (+1%)  |
+-++--+
| pickle_list | 5.93 us| 6.15 us: 1.04x slower (+4%)  |
+-++--+
| pickle_pure_python  | 581 us | 587 us: 1.01x slower (+1%)   |
+-++--+
| pidigits| 243 ms | 242 ms: 1.00x faster (-0%)   |
+-++--+
| pyflate | 885 ms | 908 ms: 1.03x slower (+3%)   |
+-++--+
| python_startup  | 27.8 ms| 28.0 ms: 1.01x slower (+1%)  |
+-++--+
| python_startup_no_site  | 22.0 ms| 22.1 ms: 1.00x slower (+0%)  |
+-++--+
| raytrace| 630 ms | 632 ms: 1.00x slower (+0%)   |
+-++--+
| regex_compile   | 215 m

[issue42094] isoformat() / fromisoformat() for datetime.timedelta

2020-11-17 Thread Erik Cederstrand


Erik Cederstrand  added the comment:

There are two conflicting interests: ISO 8601 that allows non-precise 
durations, and timedelta that assumes precise durations.

For me, the non-precise durations only make sense in date arithmetic - to a 
human, it's pretty clear what adding 3 months or a year will do to the date. 
There may be edge cases when crossing DST, but normal arithmetic with timezone 
also have those cases.

Regarding ISO weeks, I'm pretty sure that they are only special in regards to 
calculating week numbers and the weekday they start. They still have a duration 
of 7 days.

Apart from being able to parse ISO durations coming from other systems, the 
non-precise durations would be useful e.g. when implementing recurring events. 
Calculating a series of dates for something that happens on the 12th day of 
every 2nd month is doable in Python, but not with the aid of timedelta.

I see four options here:

1) expand timedelta to allow month and year, with the implication that e.g. 
total_seconds() would fail or be ambiguous for these timedeltas

2) implement only the parts of ISO 8601 that can safely be represented by the 
current timedelta

3) add a new relativetimedelta class that allows representing non-precise 
durations

4) do nothing and leave it to 3rd party packages to implement this

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2190] MozillaCookieJar ignores HttpOnly cookies

2020-11-17 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Yes. The required 'feature' was introduced through 
https://github.com/python/cpython/pull/17471/ even as the patches were slightly 
different. But keeping https://github.com/python/cpython/pull/17471/ seems fine 
and we can close this ticket and the PR.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2190] MozillaCookieJar ignores HttpOnly cookies

2020-11-17 Thread Daniel Lenski


Daniel Lenski  added the comment:

This can be closed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:

FYI I checked and AIX is fixed. All tests pass again on POWER6 AIX 3.x buildbot.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-17 Thread Yury Selivanov


Yury Selivanov  added the comment:

> That's good to know and I think more convenient to work with, so +1 from me. 
> I guess my remaining question though is whether it's okay to `await 
> lock.acquire()` on a single lock instance from multiple different running 
> event loops (presumably each in their own separate threads) or if there's a 
> need to restrict it to only one event loop.

No, it's not OK to use one lock across multiple loops at the same time. But 
most asyncio code out there doesn't have protections against that, and we never 
advertised that having multiple loops run in parallel is a good idea.  So while 
we could build protections against that, I'm not sure its needed. 

Andrew, thoughts?


> From what I've seen of asyncio user code, it seems reasonably common to 
> create async primitives (lock, semaphore, queue, etc.) in the __init__ for 
> some class prior to using the event loop, which would fail with usage of 
> `get_running_loop()` in the __init__ for the primitives. So, if it's not an 
> issue to wait until accessing the event loop until it's actually needed (e.g. 
> in the lock.acquire() or queue.get/put()), I think we should definitely try 
> to be conscious about when we call `get_running_loop()` going forward to 
> ensure we're not imposing arbitrary inconveniences on users.

Yep. This sums up how I think of this now.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42202] Optimize function annotation

2020-11-17 Thread Inada Naoki


Inada Naoki  added the comment:

I don't like co_annotations.

* It changes PyCode_NewXXX() API.

* Many functions don't have annotations. Adding annotation to code object makes 
code object fatter even if the function doesn't have annotation.

* Code object is immutable & hashable. Adding annotation to code object makes 
== and hash() complex.

* We may introduce lazy loading for docstring and annotation in the future.


func.__annotations__ =  ('x', 'int', 'z', 'float', 'return', 'Hoge') is much 
better because:

* Zero overhead for functions without any annotations.
* After annotation dict is created, the tuple can be released.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17854] symmetric difference operation applicable to more than two sets

2020-11-17 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> rejected
stage: patch review -> resolved
status: pending -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40656] Clean up detect_socket() in setup.py

2020-11-17 Thread Ned Deily


Ned Deily  added the comment:

Thanks again for the PR.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40656] Clean up detect_socket() in setup.py

2020-11-17 Thread Ned Deily


Ned Deily  added the comment:


New changeset ccdcb20cbeb1943f506a422c3fd942651389a187 by Erlend Egeberg 
Aasland in branch 'master':
bpo-40656: Clean up detect_socket() (GH-20148)
https://github.com/python/cpython/commit/ccdcb20cbeb1943f506a422c3fd942651389a187


--
nosy: +ned.deily

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-17 Thread Kyle Stanley


Kyle Stanley  added the comment:

> Oh my.  FWIW I think that we need to implement this differently. I don't 
> think it matters where, say, an asyncio.Lock was instantiated. It can be 
> created anywhere. So IMO its __init__ shouldn't try to capture the current 
> loop -- there's no need for that. The loop can be and should be captured when 
> the first `await lock.acquire()` is called.

That's good to know and I think more convenient to work with, so +1 from me. I 
guess my remaining question though is whether it's okay to `await 
lock.acquire()` on a single lock instance from multiple different running event 
loops (presumably each in their own separate threads) or if there's a need to 
restrict it to only one event loop.

> I'm writing a piece of code right now that would need to jump through the 
> hoops to simply create a new `asyncio.Lock()` in a place where there's no 
> asyncio loop yet.

>From what I've seen of asyncio user code, it seems reasonably common to create 
>async primitives (lock, semaphore, queue, etc.) in the __init__ for some class 
>prior to using the event loop, which would fail with usage of 
>`get_running_loop()` in the __init__ for the primitives. So, if it's not an 
>issue to wait until accessing the event loop until it's actually needed (e.g. 
>in the lock.acquire() or queue.get/put()), I think we should definitely try to 
>be conscious about when we call `get_running_loop()` going forward to ensure 
>we're not imposing arbitrary inconveniences on users.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40656] Clean up detect_socket() in setup.py

2020-11-17 Thread Ned Deily


Change by Ned Deily :


--
versions: +Python 3.10 -Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-17 Thread Yury Selivanov


Yury Selivanov  added the comment:

Oh my.  FWIW I think that we need to implement this differently. I don't think 
it matters where, say, an asyncio.Lock was instantiated. It can be created 
anywhere. So IMO its __init__ shouldn't try to capture the current loop -- 
there's no need for that. The loop can be and should be captured when the first 
`await lock.acquire()` is called.

I'm writing a piece of code right now that would need to jump through the hoops 
to simply create a new `asyncio.Lock()` in a place where there's no asyncio 
loop yet.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-17 Thread Kyle Stanley


Kyle Stanley  added the comment:

Sure, I would be interested in helping with this. Although if a newer 
contributor takes it up before I'm able to, I wouldn't be opposed to that 
either (my main priority at the moment is helping with PEP 594 since it's a 
concrete goal of my internship w/ the PSF, but I should have some time to work 
on this as well).

As far as I can tell though, there's currently a similar PR open: 
https://github.com/python/cpython/pull/18195 . This attempts to deprecate the 
loop argument and creating primitives such as asyncio.Lock outside of a running 
event loop with the following approach:

```
def __init__(self, *, loop=None):
self._waiters = None
self._locked = False
if loop is None:
self._loop = events._get_running_loop()
if self._loop is None:
warnings.warn("The creation of asyncio objects without a 
running "
  "event loop is deprecated as of Python 3.9.",
  DeprecationWarning, stacklevel=2)
self._loop = events.get_event_loop()
else:
warnings.warn("The loop argument is deprecated since Python 
3.8, "
  "and scheduled for removal in Python 3.10.",
  DeprecationWarning, stacklevel=2) 
```

So, do we want to add more strictness to that with always using 
`get_running_loop()` to access the event loop each time instead of accessing 
self._loop, and effectively ignore the user-supplied one? Presumably, this 
would start with a warning for passing a *loop* arg and then be removed 
entirely as a parameter ~two versions later.

> (or alternatively they can cache the running `loop`, but the first loop 
> lookup should be performed with `asyncio.get_running_loop()`)

AFAIK, at the C-API extension level, get_running_loop() already caches the 
running loop in `cached_running_holder`. 
(https://github.com/python/cpython/blob/9c98e8cc3ebf56d01183c67adbc000ed19b8e0f4/Modules/_asynciomodule.c#L232).
 So from a performance perspective, wouldn't it effectively be the same if we 
repeatedly use `get_running_loop()` to access the same event loop? I think it 
also adds a nice integrity check to be certain that the primitive wasn't 
initially created within a running event loop, and then later accessed outside 
of one.

The only concern that I can see with this approach is that users could 
potentially create a primitive in one running event loop and then access it in 
a separate loop running in a different thread (without using something like 
self._loop, the primitive would no longer be associated with a specific event 
loop and could potentially used within *any* running event loop). I'm not 
entirely certain if that is a real problem though, and if anything, it seems 
like it could prove to be useful in some multi-loop environment. I just want to 
make sure that it's intended.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42395] aclosing was not added to __all__ in contextlib

2020-11-17 Thread miss-islington


miss-islington  added the comment:


New changeset d0d4a450679bfc90eae7be4fdb5499e87f661b3e by Tom Gringauz in 
branch 'master':
bpo-42395: Add aclosing to __all__ (GH-23356)
https://github.com/python/cpython/commit/d0d4a450679bfc90eae7be4fdb5499e87f661b3e


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42396] Add a whatsnew entry about async contextlib.nullcontext

2020-11-17 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42396] Add a whatsnew entry about async contextlib.nullcontext

2020-11-17 Thread miss-islington


New submission from miss-islington :


New changeset 9c98e8cc3ebf56d01183c67adbc000ed19b8e0f4 by Tom Gringauz in 
branch 'master':
bpo-42396: Add a whatsnew entry about async contextlib.nullcontext (GH-23357)
https://github.com/python/cpython/commit/9c98e8cc3ebf56d01183c67adbc000ed19b8e0f4


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42332] add __weakref__ to types.GenericAlias

2020-11-17 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42332] add __weakref__ to types.GenericAlias

2020-11-17 Thread miss-islington


miss-islington  added the comment:


New changeset 71ba5f52d2a80e7beffc923c54c0b6345cd0637a by kj in branch '3.9':
[3.9] bpo-42332: Add weakref slot to types.GenericAlias (GH-23250) (GH-23309)
https://github.com/python/cpython/commit/71ba5f52d2a80e7beffc923c54c0b6345cd0637a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42396] Add a whatsnew entry about async contextlib.nullcontext

2020-11-17 Thread Tom Gringauz


Change by Tom Gringauz :


--
keywords: +patch
pull_requests: +22250
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23357

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:

> For the signal module, see bpo-41713.

Done: the _signal module uses again the multi-phase init API.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:

Done! _signal uses again the multi-phase init API.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7f9b25a21ab95f8cf8d663396993766307be475c by Victor Stinner in 
branch 'master':
bpo-41713: Port _signal module to multi-phase init (GH-23355)
https://github.com/python/cpython/commit/7f9b25a21ab95f8cf8d663396993766307be475c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42395] aclosing was not added to __all__ in contextlib

2020-11-17 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
versions: +Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42396] Add a whatsnew entry about async contextlib.nullcontext

2020-11-17 Thread Tom Gringauz


Change by Tom Gringauz :


--
nosy: tomgrin10
priority: normal
severity: normal
status: open
title: Add a whatsnew entry about async contextlib.nullcontext

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42395] aclosing was not added to __all__ in contextlib

2020-11-17 Thread Tom Gringauz


Change by Tom Gringauz :


--
keywords: +patch
pull_requests: +22249
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23356

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17887] docs: summary page - generator vs iterator vs iterable

2020-11-17 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.3, Python 
3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42395] aclosing was not added to __all__ in contextlib

2020-11-17 Thread Tom Gringauz


New submission from Tom Gringauz :

Related to this PR https://github.com/python/cpython/pull/21545

--
components: Library (Lib)
messages: 381296
nosy: tomgrin10
priority: normal
severity: normal
status: open
title: aclosing was not added to __all__ in contextlib

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1de61d3923840b29e847d311f0c7d4c5821d98e6 by Victor Stinner in 
branch 'master':
bpo-41625: Skip os.splice() tests on AIX (GH-23354)
https://github.com/python/cpython/commit/1de61d3923840b29e847d311f0c7d4c5821d98e6


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2020-11-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22248
pull_request: https://github.com/python/cpython/pull/23355

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-41686: Move _Py_RestoreSignals() to signalmodule.c (GH-23353)

Sorry, this change was for bpo-41713.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:

New changeset 29aa624047f893b3b3194f00252b2156bbbf4f9b by Victor Stinner in 
branch 'master':
bpo-41686: Move _Py_RestoreSignals() to signalmodule.c (GH-23353)
https://github.com/python/cpython/commit/29aa624047f893b3b3194f00252b2156bbbf4f9b

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 29aa624047f893b3b3194f00252b2156bbbf4f9b by Victor Stinner in 
branch 'master':
bpo-41686: Move _Py_RestoreSignals() to signalmodule.c (GH-23353)
https://github.com/python/cpython/commit/29aa624047f893b3b3194f00252b2156bbbf4f9b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42394] Exception handling on boolean comparisons

2020-11-17 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This is not a bug, it is normal handling of `and` and `or` operators since 
Python 1.5 and possibly older.

The `and` and `or` operators are *short-cut* operators. This is intentional 
design, so we can write things like:

if mylist and mylist[0] == value:

the `mylist[0] == value` expression is only evaluated if `mylist` is a truthy 
value.

This is all documented here:

https://docs.python.org/3/reference/expressions.html#boolean-operations

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:

Nice, AIX can build again Python. But now the 3 tests fail since the test uses 
a pipe and a file, whereas on AIX, it seems like splice() requires one end to 
be a socket.

I wrote attached PR 23354 to skip the 3 tests on AIX.

==
ERROR: test_splice (test.test_os.FileTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_os.py", 
line 406, in test_splice
i = os.splice(in_fd, write_fd, 5)
OSError: [Errno 57] Socket operation on non-socket

==
ERROR: test_splice_offset_in (test.test_os.FileTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_os.py", 
line 440, in test_splice_offset_in
i = os.splice(in_fd, write_fd, bytes_to_copy, offset_src=in_skip)
OSError: [Errno 57] Socket operation on non-socket

==
ERROR: test_splice_offset_out (test.test_os.FileTests)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/build/Lib/test/test_os.py", 
line 479, in test_splice_offset_out
i = os.splice(read_fd, out_fd, bytes_to_copy, offset_dst=out_seek)
OSError: [Errno 57] Socket operation on non-socket

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22247
pull_request: https://github.com/python/cpython/pull/23354

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42394] Exception handling on boolean comparisons

2020-11-17 Thread Christopher Contaxis


New submission from Christopher Contaxis :

Python 3.8.6 will not produce an exception when comparing values in an and/or 
statement that normally produces an exception standalone.

val = 0
low = 1
high = "2"

The following makes sense:

val >= low : False
val <= high : Exception, cant compare int and str
val <= high and val >= low : Exception, cant compare int and str

The following doesn't make sense (doesn't produce an exception):

val >= low and val <= high : False

--
messages: 381289
nosy: CanisUrsa
priority: normal
severity: normal
status: open
title: Exception handling on boolean comparisons
type: behavior
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12545] os.lseek() and FileIO.seek() does not support offset larger than 2^63-1

2020-11-17 Thread Charles-François Natali

Change by Charles-François Natali :


--
nosy:  -neologix

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22246
pull_request: https://github.com/python/cpython/pull/23353

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, the issue should now be fixed in 3.8, 3.9 and master branches. Thanks for 
the bug report hafiz bilal.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a702bd4b921167e73f8fc987aa64ada571fdc3f8 by Victor Stinner in 
branch '3.8':
bpo-41686: Always create the SIGINT event on Windows (GH-23344) (GH-23347) 
(GH-23349)
https://github.com/python/cpython/commit/a702bd4b921167e73f8fc987aa64ada571fdc3f8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a702bd4b921167e73f8fc987aa64ada571fdc3f8 by Victor Stinner in 
branch '3.8':
bpo-41686: Always create the SIGINT event on Windows (GH-23344) (GH-23347) 
(GH-23349)
https://github.com/python/cpython/commit/a702bd4b921167e73f8fc987aa64ada571fdc3f8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37733] Fail to build _curses module of Python 3.7.4 on AIX 7.1 using gcc

2020-11-17 Thread Kevin


Kevin  added the comment:

Both 3.6 and 3.7 are in security only mode so at this point, so if the issue is 
fixed in newer versions I think this issue could be closed.

--
nosy: +kadler

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37009] Threading and THREAD_SAFE for AIX

2020-11-17 Thread Kevin


Change by Kevin :


--
nosy: +kadler

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42393] Raise overflow errors iso. deprecation warnings in socket.htons and socket.ntohs (was deprecated in 3.7)

2020-11-17 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

Silent truncation was deprecated in Python 3.7 in bpo-28332 with commit 
6a7d3480fc8fe4c60538547d2935083ccff0f631 by Serhiy Storchaka. It should be ok 
to turn these into OverflowError's starting with Python 3.10.

--
components: Library (Lib)
files: error_iso_warning.patch
keywords: patch
messages: 381284
nosy: erlendaasland, pablogsal, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Raise overflow errors iso. deprecation warnings in socket.htons and 
socket.ntohs (was deprecated in 3.7)
versions: Python 3.10
Added file: https://bugs.python.org/file49605/error_iso_warning.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42393] Raise overflow errors iso. deprecation warnings in socket.htons and socket.ntohs (was deprecated in 3.7)

2020-11-17 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11188] test_time error on AIX

2020-11-17 Thread Kevin


Change by Kevin :


--
nosy: +kadler

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13281] Make robotparser.RobotFileParser ignore blank lines

2020-11-17 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9 -Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18122] RuntimeError: not holding the import lock

2020-11-17 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as this is a python-2 only issue.

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread miss-islington


miss-islington  added the comment:


New changeset 2a9eddf070f72060f62db1856a0af2e08729a46c by Pablo Galindo in 
branch 'master':
bpo-41625: Add a guard for Linux for splice() constants in the os module 
(GH-23350)
https://github.com/python/cpython/commit/2a9eddf070f72060f62db1856a0af2e08729a46c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread miss-islington

miss-islington  added the comment:


New changeset e59958f8b6815f51f6c33b6a613cf8467ca18a11 by Pablo Galindo in 
branch 'master':
bpo-41625: Specify that Linux >= 2.6.17 *and* glibc >= 2.5 are requir… 
(GH-23351)
https://github.com/python/cpython/commit/e59958f8b6815f51f6c33b6a613cf8467ca18a11


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-11-17 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 48a9c0eb2a3304ea64d1b32fdf9db853d5d8c429 by Irit Katriel in 
branch '3.9':
[3.9] bpo-39934: Account for control blocks in 'except' in compiler. (GH-22395) 
(GH-23303)
https://github.com/python/cpython/commit/48a9c0eb2a3304ea64d1b32fdf9db853d5d8c429


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42349] Compiler front-end produces a broken CFG

2020-11-17 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 266b462238bddec0213effad3650f19c56511e9f by Mark Shannon in 
branch 'master':
bpo-42349: Compiler clean up. More yak-shaving for PEP 626. (GH-23267)
https://github.com/python/cpython/commit/266b462238bddec0213effad3650f19c56511e9f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

This was on my to-do list but I very much appreciate if somebody champions this 
issue.
I should finish sslproto PR first.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15004] add weakref support to types.SimpleNamespace

2020-11-17 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9 -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12545] os.lseek() and FileIO.seek() does not support offset larger than 2^63-1

2020-11-17 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9 -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-17 Thread Yury Selivanov


Yury Selivanov  added the comment:

Kyle, lmk if you want to work on this.

--
nosy: +aeros

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-17 Thread Yury Selivanov


Yury Selivanov  added the comment:

(or alternatively they can cache the running `loop`, but the first loop lookup 
should be performed with `asyncio.get_running_loop()`)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-17 Thread Yury Selivanov


New submission from Yury Selivanov :

asyncio.Lock and other primitives should no longer accept the `loop` parameter. 
They should also stop storing the current loop in the `self._loop` attribute. 
Instead, they should use `get_running_loop()` whenever they need to access the 
loop.

--
components: asyncio
messages: 381275
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: remove the 'loop' parameter from __init__ in all classes in asyncio.locks
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42390] Other Python implementations may not expose the module name in datetime type names

2020-11-17 Thread Paul Ganssle


Paul Ganssle  added the comment:

What is an example of another Python implementation that has this property? Is 
there a concrete issue open somewhere that this is solving?

I am not unsympathetic to the idea of accommodating other implementations of 
Python, but this is very abstract and I think the assumption is probably that 
if we're explicitly testing for something and we don't say it's 
implementation-defined that it is part of the language spec.

If there's some evidence that stuff like this is intended to be 
implementation-defined always, or there's some concrete problem that we can 
solve (and possibly also add tests to avoid regressions), I'd be much more 
comfortable with something like this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42094] isoformat() / fromisoformat() for datetime.timedelta

2020-11-17 Thread Paul Ganssle

Paul Ganssle  added the comment:

This is probably more feasible than the proposal in bpo-41254 since it's a 
well-defined spec (mostly — it includes an optional alternative format and the 
number of digits allowed is defined "by agreement", thus defeating the purpose 
of using a spec in the first place) that's not even particularly difficult to 
implement, but there are still a few problems (and one reason I've never 
implemented this, despite desperately wanting a better string representation 
for time deltas). Two minor problems first:

1. Unlike ISO 8601 datetimes, these are not especially "human-friendly" 
formats, so I don't think they're especially useful for displaying timedeltas.

2. Also unlike ISO 8601 datetimes, I don't think these are in particularly wide 
use, or widely supported. That's not a major strike against it, but if it's not 
useful as something to show to humans and it's not especially useful as 
something to show to / read from other computers, that weighs against its 
inclusion in the standard library.

The biggest problem, however, is that `timedelta` does not and cannot represent 
"Year" or "Month", which means that `P1Y` or `P1M` would always need to be 
invalid to parse. We could eliminate this format, but it means that we would 
never at any point in the future be able to implement a parser for the full 
spec. Since the concept of a year and a month are ambiguous and at least the 
2016 version of ISO 8601 doesn't seem to define what it means for a duration to 
last 1 year or 1 month, you can't even really count on such a thing as an 
interchange format, because different implementations might give you different 
results! What does `20200131T00:00:00/P1M` represent? The interval (2020-01-31, 
2020-02-29)? (2020-01-31, 2020-03-02)? Something else?

A better target for parsing ISO 8601 durations would be something like 
`dateutil.relativedelta`, which does have defined semantics for years and 
months (though as I mentioned above, those are not necessarily consistent with 
the semantics of other libraries parsing or writing out this format).

I am also not entirely clear on whether "weeks" is just an alias for "7 days" 
or if it means something related to weeks in the ISO calendar (and if that 
makes a difference for durations).

I imagine that generating these formats is a bit more forgiving, because you 
would simply never generate the forbidden formats, and we can offer 
configuration options in the formatter method to allow the user to tweak the 
various ambiguities in the spec.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42202] Optimize function annotation

2020-11-17 Thread Yurii Karabas


Yurii Karabas <1998uri...@gmail.com> added the comment:

I have run tests with different types of function declaration.


A function declaration with annotations is more than 2 times faster with the 
co_annotatins feature.

If function doesn't have annotations time almost same as without co_annotatins 
feature.

Results:
```
def foo(x: int, /, y, *, z: float) -> int: pass

Python 3.8.3
500 loops, best of 5: 178 nsec per loop
Python 3.9.0
500 loops, best of 5: 210 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 122 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 53.3 nsec per loop

def f(a: int, /, b: int, *, c: int) -> None: pass

Python 3.8.3
500 loops, best of 5: 208 nsec per loop
Python 3.9.0
500 loops, best of 5: 235 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 139 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 53.2 nsec per loop

def f(a: int, /, b: int, *, c: int, **d: int) -> None: pass

Python 3.8.3
500 loops, best of 5: 224 nsec per loop
Python 3.9.0
500 loops, best of 5: 257 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 167 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 55.9 nsec per loop

def f(a: int, b: str) -> None: pass

Python 3.6.8
500 loops, best of 3: 0.163 usec per loop
Python 3.7.6
500 loops, best of 5: 165 nsec per loop
Python 3.8.3
500 loops, best of 5: 165 nsec per loop
Python 3.9.0
500 loops, best of 5: 184 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 125 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 54.5 nsec per loop

def f(a: int, *, b: int) -> None: pass

Python 3.6.8
500 loops, best of 3: 0.166 usec per loop
Python 3.7.6
500 loops, best of 5: 170 nsec per loop
Python 3.8.3
500 loops, best of 5: 155 nsec per loop
Python 3.9.0
500 loops, best of 5: 198 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 124 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 54.3 nsec per loop

def f(a, /, b, *, c) -> None: pass

Python 3.8.3
500 loops, best of 5: 90.1 nsec per loop
Python 3.9.0
500 loops, best of 5: 96.3 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 93.8 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 55.5 nsec per loop

def f(a, /, b, *, c, **d) -> None: pass

Python 3.8.3
500 loops, best of 5: 92.3 nsec per loop
Python 3.9.0
500 loops, best of 5: 98 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 92.6 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 54.4 nsec per loop

def f(a, b) -> None: pass

Python 3.6.8
500 loops, best of 3: 0.0966 usec per loop
Python 3.7.6
500 loops, best of 5: 92.5 nsec per loop
Python 3.8.3
500 loops, best of 5: 87.5 nsec per loop
Python 3.9.0
500 loops, best of 5: 93.7 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 88.3 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 53 nsec per loop

def f(a, *, b) -> None: pass

Python 3.6.8
500 loops, best of 3: 0.0951 usec per loop
Python 3.7.6
500 loops, best of 5: 92.4 nsec per loop
Python 3.8.3
500 loops, best of 5: 86.6 nsec per loop
Python 3.9.0
500 loops, best of 5: 93.6 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 89.8 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 53.6 nsec per loop

def f(): pass

Python 3.6.8
500 loops, best of 3: 0.0502 usec per loop
Python 3.7.6
500 loops, best of 5: 47.7 nsec per loop
Python 3.8.3
500 loops, best of 5: 47.9 nsec per loop
Python 3.9.0
500 loops, best of 5: 46.7 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 50.8 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 52 nsec per loop

def f(a, /, b, *, c): pass

Python 3.8.3
500 loops, best of 5: 47.9 nsec per loop
Python 3.9.0
500 loops, best of 5: 47.4 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 50.2 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 52.8 nsec per loop

def f(a, /, b, *, c, **d): pass

Python 3.8.3
500 loops, best of 5: 48.7 nsec per loop
Python 3.9.0
500 loops, best of 5: 48.2 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 50.8 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 52.4 nsec per loop

def f(a, b): pass

Python 3.6.8
500 loops, best of 3: 0.0498 usec per loop
Python 3.7.6
500 loops, best of 5: 48.5 nsec per loop
Python 3.8.3
500 loops, best of 5: 47.5 nsec per loop
Python 3.9.0
500 loops, best of 5: 47 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 51 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 52.6 nsec per loop

def f(a, *, b): pass

Python 3.6.8
500 loops, best of 3: 0.0498 usec per loop
Python 3.7.6
500 loops, best of 5: 48.1 nsec 

[issue42390] Other Python implementations may not expose the module name in datetime type names

2020-11-17 Thread William Meehan


William Meehan  added the comment:

For Python implementations that change the underlying object structure, it's 
not necessarily possible to recreate the `tp_name` that would be exposed in 
CPython. The `datetime` ends up in `__module__`, while only the type name ends 
up in `__name__`. There's no way to tell that the value in `__module__` 
actually came from `tp_name` in the first place.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17854] symmetric difference operation applicable to more than two sets

2020-11-17 Thread Irit Katriel


Irit Katriel  added the comment:

I agree that the doc is fine as it is.  If there will be no 
objections/suggestions in the next couple of weeks I will close this issue.

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42094] isoformat() / fromisoformat() for datetime.timedelta

2020-11-17 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42390] Other Python implementations may not expose the module name in datetime type names

2020-11-17 Thread Paul Ganssle


Paul Ganssle  added the comment:

Is this an actual problem for another implementation of Python?

Is there some reason to think that we intended the repr of a `datetime` object 
to be implementation-defined?

--
nosy: +p-ganssle

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +22245
pull_request: https://github.com/python/cpython/pull/23351

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +22244
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/23350

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset fa96608513b6eafe48777f1a5504134939dcbebc by Pablo Galindo in 
branch 'master':
bpo-41625: Add versionadded to os.splice() constants (GH-23340)
https://github.com/python/cpython/commit/fa96608513b6eafe48777f1a5504134939dcbebc


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2020-11-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22243
pull_request: https://github.com/python/cpython/pull/23349

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22242
pull_request: https://github.com/python/cpython/pull/23349

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 05a5d697f4f097f37c5c1e2ed0e2338a33c3fb6a by Victor Stinner in 
branch '3.9':
bpo-41686: Always create the SIGINT event on Windows (GH-23344) (GH-23347)
https://github.com/python/cpython/commit/05a5d697f4f097f37c5c1e2ed0e2338a33c3fb6a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 05a5d697f4f097f37c5c1e2ed0e2338a33c3fb6a by Victor Stinner in 
branch '3.9':
bpo-41686: Always create the SIGINT event on Windows (GH-23344) (GH-23347)
https://github.com/python/cpython/commit/05a5d697f4f097f37c5c1e2ed0e2338a33c3fb6a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset cda23be092f4a72e4f335cf182f11e7bd7fd98eb by Victor Stinner in 
branch 'master':
bpo-41686: Refactor signal_exec() (GH-23346)
https://github.com/python/cpython/commit/cda23be092f4a72e4f335cf182f11e7bd7fd98eb


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42202] Optimize function annotation

2020-11-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If you want to measure import time, use

  python -m timeit -s "from sys import modules; modules_copy = modules.copy()" 
"import black; modules.clear(); modules.update(modules_copy)"

But I would be surprised to see significant difference in this case.

What Mark means, measure the time of creation of nested function.

  python -m timeit "def f(a: int, b: str) -> None: pass"

And maybe test with different number of arguments if there is a difference.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42391] Clarify documentation of TestCase.assertIs

2020-11-17 Thread Ram Rachum


Change by Ram Rachum :


--
keywords: +patch
pull_requests: +22241
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23348

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42391] Clarify documentation of TestCase.assertIs

2020-11-17 Thread Ram Rachum


New submission from Ram Rachum :

Writing the patch now.

--
assignee: docs@python
components: Documentation
messages: 381263
nosy: cool-RR, docs@python
priority: normal
severity: normal
status: open
title: Clarify documentation of TestCase.assertIs
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-17 Thread Mark Dickinson


Mark Dickinson  added the comment:

[Victor]

> How can we fix the buildbot? Add #ifdef in mathmodule.c to implement the 
> special cases, but only on AIX? Skip the test?

I'm not super-keen on using #ifdefs to implement the special-case handling 
_just_ for AIX: that opens the door to a labyrinth of #ifdef'ery working around 
various different problems on various different platforms. If we're going to 
handle special cases ourselves, let's do it for all platforms.

But I'd also be fine with skipping the test (just on AIX, of course) for now. 
If we can also find a way to remind ourselves to revisit once the upstream bug 
has been fixed, so much the better.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:

> The splice() system call first appeared in Linux 2.6.17;
> library support was added to glibc in version 2.5.

There is no emulation. It's just a function which wraps the syscall:

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/splice.c;h=fe21cf1988c48ce887a22c9e5e5f36cbd653a4c8;hb=HEAD

I understand that you need Linux kernel >= 2.6.17 *and* glibc >= 2.5.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42323] [AIX] test_math: test_nextafter(float('nan'), 1.0) does not return a NaN on AIX

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:

> "./Modules/posixmodule.c", line 15146.53: 1506-045 (S) Undeclared identifier 
> SPLICE_F_MOVE.

This is unrelated: https://bugs.python.org/issue41625#msg381259 Please continue 
the discussion this SPLICE there.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41625] Add splice() to the os module

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue. This issue broke Python compilation on AIX.

https://buildbot.python.org/all/#/builders/302/builds/377

configure: "checking for splice... yes"

"./Modules/posixmodule.c", line 15146.53: 1506-045 (S) Undeclared identifier 
SPLICE_F_MOVE.
"./Modules/posixmodule.c", line 15147.57: 1506-045 (S) Undeclared identifier 
SPLICE_F_NONBLOCK.
"./Modules/posixmodule.c", line 15148.53: 1506-045 (S) Undeclared identifier 
SPLICE_F_MORE.

make: 1254-004 The error code from the last command is 1.


The code:

/* constants for splice */
#ifdef HAVE_SPLICE
if (PyModule_AddIntConstant(m, "SPLICE_F_MOVE", SPLICE_F_MOVE)) return -1;
if (PyModule_AddIntConstant(m, "SPLICE_F_NONBLOCK", SPLICE_F_NONBLOCK)) 
return -1;
if (PyModule_AddIntConstant(m, "SPLICE_F_MORE", SPLICE_F_MORE)) return -1;
#endif

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13875] Improve description of cmd module

2020-11-17 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22239
pull_request: https://github.com/python/cpython/pull/23347

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2020-11-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22240
pull_request: https://github.com/python/cpython/pull/23347

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22238
pull_request: https://github.com/python/cpython/pull/23346

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0ae323b87f1bed64a7fa70f5a41a5800aca032cc by Victor Stinner in 
branch 'master':
bpo-41686: Always create the SIGINT event on Windows (GH-23344)
https://github.com/python/cpython/commit/0ae323b87f1bed64a7fa70f5a41a5800aca032cc


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0ae323b87f1bed64a7fa70f5a41a5800aca032cc by Victor Stinner in 
branch 'master':
bpo-41686: Always create the SIGINT event on Windows (GH-23344)
https://github.com/python/cpython/commit/0ae323b87f1bed64a7fa70f5a41a5800aca032cc


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23023] ./Modules/ld_so_aix not found on AIX during test_distutils

2020-11-17 Thread Kevin


Kevin  added the comment:

Is this issue still relevant? I can't find any current buildbot errors on AIX 
for this test.

--
nosy: +kadler

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42202] Optimize function annotation

2020-11-17 Thread Jakub Stasiak


Jakub Stasiak  added the comment:

Yurii, I don't believe that benchmark measures what you need to measure (once 
imported module is kept imported forever until unloaded, so successive imports 
are no-ops).

See how the side effects of importing bbb only happen once: 

% cat bbb.py 
import time
time.sleep(1)
with open('bbb.log', 'a') as f:
written = f.write('hello\n')
assert written == 6

% time python -m timeit "import bbb"
1 loop, best of 5: 515 nsec per loop
python -m timeit "import bbb"  0.03s user 0.01s system 4% cpu 1.050 total

% cat bbb.log 
hello

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42264] Deprecate or remove sqlite3.OptimizedUnicode

2020-11-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42385] Should enum.auto's behavior be adjusted for StrEnum to return the enum name?

2020-11-17 Thread Ethan Furman


Ethan Furman  added the comment:

A good idea.

Since the Python opinion of enum members is that they be upper-cased, and every 
magic string constant I have seen is lower-case, 
`StrEnum._generate_next_value_` should lower case the name.  Users can 
substitute their own `_gnv_` for different behavior.

--
assignee:  -> ethan.furman
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42202] Optimize function annotation

2020-11-17 Thread Yurii Karabas


Yurii Karabas <1998uri...@gmail.com> added the comment:

I have just implemented `co_annotations` field for `CodeObject`.
I wrote a simple benchmark to measure the time required to import black module 
(I took black because it contains a log of annotations).

Benchmark simply run `python -m timeit -n 500 "import black"`.

Results:
```
Python 3.6.8
500 loops, best of 3: 0.0983 usec per loop
Python 3.7.6
500 loops, best of 5: 102 nsec per loop
Python 3.8.3
500 loops, best of 5: 97.4 nsec per loop
Python 3.9.0
500 loops, best of 5: 99.5 nsec per loop
Python 3.10.0a2+ with co_annotations
500 loops, best of 5: 92.4 nsec per loop
Python 3.10.0a2+
500 loops, best of 5: 98.9 nsec per loop
```

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42390] Other Python implementations may not expose the module name in datetime type names

2020-11-17 Thread William Meehan


Change by William Meehan :


--
keywords: +patch
pull_requests: +22237
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23345

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42264] Deprecate or remove sqlite3.OptimizedUnicode

2020-11-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a1f401a58b213e400fbd8f0fa8dc5260a2389dab by Erlend Egeberg 
Aasland in branch 'master':
bpo-42264: Deprecate sqlite3.OptimizedUnicode (GH-23163)
https://github.com/python/cpython/commit/a1f401a58b213e400fbd8f0fa8dc5260a2389dab


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42202] Optimize function annotation

2020-11-17 Thread Mark Shannon


Mark Shannon  added the comment:

For top level functions (functions created once) this isn't going to make any 
real difference. There might be a small speedup for function creation, but it 
isn't going to be measurable.

For nested functions with annotations, where many functions are created from a 
single code object, this could be worthwhile.

However, before we add yet another attribute to code objects, I'd like to see 
some evidence of a speedup.

--
nosy: +Mark.Shannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42386] Update icons for macOS 11

2020-11-17 Thread Forrest Jiang


Forrest Jiang <17jian...@gmail.com> added the comment:

On another note, beginning with Big Sur, document icons can be 
system-generated: https://developer.apple.com/news/?id=5i6jlf4d

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-17 Thread Guido van Rossum

Guido van Rossum  added the comment:

I recommend adding a whatsnew entry too. You can just add it to this issue. 
Interestingly you’ll probably need two separate ones, for 3.9 and 3.10. That 
would become two separate PRs for master, the 3.9 one to be backported.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >