[issue45896] Conflicting statements in docs about default support for asyncio subprocesses on Windows

2021-11-24 Thread Rob
Rob added the comment: Ok will do. Thanks for confirming. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45896] Conflicting statements in docs about default support for asyncio subprocesses on Windows

2021-11-24 Thread Andrew Svetlov
Andrew Svetlov added the comment: You are correct, the first statement is outdated. Please feel free to make a pull request. -- ___ Python tracker ___

[issue45897] Frozen dataclasses with slots raise TypeError

2021-11-24 Thread Eric V. Smith
Change by Eric V. Smith : -- versions: +Python 3.11 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45897] Frozen dataclasses with slots raise TypeError

2021-11-24 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45897] Frozen dataclasses with slots raise TypeError

2021-11-24 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45897] Frozen dataclasses with slots raise TypeError

2021-11-24 Thread Alex Waygood
Alex Waygood added the comment: This looks to be due to the fact that `slots=True` leads to the creation of an entirely new class (see line 1102), meaning that in the `super(cls, self)` calls in lines 611 and 618 (in the `_frozen_get_del_attr` function, responsible for generating

[issue45897] Frozen dataclasses with slots raise TypeError

2021-11-24 Thread Trey Hunner
New submission from Trey Hunner : When making a dataclass with slots=True and frozen=True, assigning to an invalid attribute raises a TypeError rather than a FrozenInstanceError: >>> from dataclasses import dataclass >>> @dataclass(frozen=True, slots=True) ... class Vector: ... x: float

[issue45896] Conflicting statements in docs about default support for asyncio subprocesses on Windows

2021-11-24 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +asvetlov, yselivanov type: -> behavior versions: +Python 3.11, Python 3.9 ___ Python tracker ___

[issue45727] Parse error when missing commas is inconsistent

2021-11-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset c72311d91787005713bb5daf4532a86e06496afd by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if inside parentheses. (GH-29767)

[issue45876] Improve accuracy of stdev functions in statistics

2021-11-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Here's a reference for this use of round-to-odd: > https://www.lri.fr/~melquion/doc/05-imacs17_1-expose.pdf Thanks Mark. It looks like I'll be getting a little education over the Thanksgiving holiday :-) Shown below is the code that I'm thinking of

[issue45894] exception lost when loop.stop() in finally

2021-11-24 Thread Amos Anderson
Amos Anderson added the comment: Ah, thank you, Serhiy. I didn't know that, but I see that in the documentation: https://docs.python.org/3/reference/compound_stmts.html#the-try-statement But what about the 2nd case I presented where a `RuntimeError` was raised? That's the actual case I'm

[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-24 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +28006 pull_request: https://github.com/python/cpython/pull/29769 ___ Python tracker ___

[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-24 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +28005 pull_request: https://github.com/python/cpython/pull/29768 ___ Python tracker ___

[issue45892] Improve REPL with the underscore separators for int/float

2021-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: And you can probably use sitecustomize.py to import this. Since I don't see any action item here, I'm going to close this issue. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python

[issue44724] multiprocessing: the Resource Tracker process is never reaped

2021-11-24 Thread Alex Willmer
Change by Alex Willmer : -- nosy: +Alex.Willmer ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45727] Parse error when missing commas is inconsistent

2021-11-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 24c10d2943c482c4d3ecc71d45df2d8c10fa5bb1 by Pablo Galindo Salgado in branch 'main': bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if inside parentheses (GH-29757)

[issue45896] Conflicting statements in docs about default support for asyncio subprocesses on Windows

2021-11-24 Thread Rob
New submission from Rob : Hi, In the docs for the asyncio event loop, it has a note on page: https://docs.python.org/3/library/asyncio-eventloop.html#running-subprocesses "Note The default asyncio event loop on Windows does not support subprocesses. See Subprocess Support on Windows for

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread Christian Heimes
Christian Heimes added the comment: You are welcome! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread miss-islington
miss-islington added the comment: New changeset cd85d91bc66a587ce2ba668c897a5ecf118733cc by Miss Islington (bot) in branch '3.10': bpo-45893: Add missing extern C to initconfig.h (GH-29761) https://github.com/python/cpython/commit/cd85d91bc66a587ce2ba668c897a5ecf118733cc --

[issue45895] _Py_Sigset_Converter used without #ifdef HAVE_SIGSET_T check

2021-11-24 Thread Christian Heimes
New submission from Christian Heimes : posixmodule.c defines _Py_Sigset_Converter() only when feature macro HAVE_SIGSET_T is set. Several use of the function miss the feature macro check and fail on platforms without sigset_t (e.g. wasm). Modules/posixmodule.c:5939:14: error: implicit

[issue10552] Tools/unicode/gencodec.py error

2021-11-24 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread STINNER Victor
STINNER Victor added the comment: > Seems we lost the C++ handling in Include/cpython/initconfig.h I was never in initconfig.h since the PEP 587 (PyConfig C API) was implemented. I'm not sure why the build *started* to fail on Windows. Thanks for fixing the issue ;-) --

[issue45894] exception lost when loop.stop() in finally

2021-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not related to loop.stop() and asyncio in general. It is the return statement which eats the exception. Simpler example: >>> def f(): ... try: ... 1/0 ... finally: ... return 42 ... >>> f() 42 Return (and also break and

[issue45894] exception lost when loop.stop() in finally

2021-11-24 Thread Amos Anderson
Amos Anderson added the comment: If I do this instead: ``` try: logger.info("raising exception") raise ValueError("my exception1") finally: logger.info("stopped") loop.stop() await asyncio.sleep(0.5) ``` i.e., do an `await` instead of a

[issue45727] Parse error when missing commas is inconsistent

2021-11-24 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +28004 pull_request: https://github.com/python/cpython/pull/29767 ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> docs@python components: +Documentation nosy: +docs@python versions: +Python 3.11 -Python 3.8 ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for the PR, @jcristharif. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 151c9bf649a049f52df388a8f2390988949abf59 by Miss Islington (bot) in branch '3.9': bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760) (GH-29763)

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 8cabcde8d66bfd8abc98b862c93c66946f8514a1 by Miss Islington (bot) in branch '3.10': bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760) (GH-29762)

[issue45894] exception lost when loop.stop() in finally

2021-11-24 Thread Amos Anderson
New submission from Amos Anderson : I found a case where an exception is lost if the loop is stopped in a `finally`. ``` import asyncio import logging logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger() async def method_that_raises(): loop = asyncio.get_event_loop()

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread miss-islington
Change by miss-islington : -- keywords: +patch nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +28003 pull_request: https://github.com/python/cpython/pull/29765 ___ Python tracker

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread Christian Heimes
Christian Heimes added the comment: New changeset f4afc53bf68c8ded20b281cd1baa88a679b4a3fd by Christian Heimes in branch 'main': bpo-45893: Add missing extern C to initconfig.h (GH-29761) https://github.com/python/cpython/commit/f4afc53bf68c8ded20b281cd1baa88a679b4a3fd --

[issue10552] Tools/unicode/gencodec.py error

2021-11-24 Thread Irit Katriel
Irit Katriel added the comment: I don't think Martin's patch has been applied. Is it needed? -- nosy: +iritkatriel ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread miss-islington
miss-islington added the comment: New changeset d71c7bc7339eb82de493c66ebbbfa1cad250ac78 by Jim Crist-Harif in branch 'main': bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760) https://github.com/python/cpython/commit/d71c7bc7339eb82de493c66ebbbfa1cad250ac78 --

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +28002 pull_request: https://github.com/python/cpython/pull/29764 ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +28001 pull_request: https://github.com/python/cpython/pull/29763 ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +28000 pull_request: https://github.com/python/cpython/pull/29762 ___ Python tracker ___

[issue43805] multiprocessing.Queue hangs when process on other side dies

2021-11-24 Thread Thomas Kluyver
Thomas Kluyver added the comment: I think this is expected. The queue itself doesn't know that one particular process is meant to put data into it. It just knows that there's no data to get, so .get() blocks as the docs say it should. This doesn't apply to issue22393, because the pool knows

[issue18061] m68k Python 3.3 test results

2021-11-24 Thread Irit Katriel
Irit Katriel added the comment: Python 3.3 is no longer maintained, and there was no activity on this for 8 years, so I am closing. If there are still issues with these tests on a current version (>= 3.9), please create a new issue. -- nosy: +iritkatriel resolution: -> fixed stage:

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread Christian Heimes
Change by Christian Heimes : -- keywords: -patch type: -> compile error versions: +Python 3.10 ___ Python tracker ___ ___

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +27999 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29761 ___ Python tracker

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Jim Crist-Harif
Jim Crist-Harif added the comment: Apologies for the delay here. I've pushed a documentation patch at https://github.com/python/cpython/pull/29760. -- ___ Python tracker ___

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread Guido van Rossum
Guido van Rossum added the comment: Christian thinks that a PR by Victor broke this (GH-29488 / bpo-39026) -- nosy: +vstinner ___ Python tracker ___

[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-24 Thread Jim Crist-Harif
Change by Jim Crist-Harif : -- keywords: +patch pull_requests: +27998 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29760 ___ Python tracker ___

[issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly

2021-11-24 Thread Thomas Kluyver
Thomas Kluyver added the comment: In the example script, I believe you need to close the write end of the pipe in the parent after forking: cpid = os.fork() if cpid == 0: # Write to pipe (child) else: # Parent os.close(ctx) # Read from pipe This is the same with synchronous

[issue45020] Freeze all modules imported during startup.

2021-11-24 Thread Christian Heimes
Christian Heimes added the comment: New changeset 5c4b19ec49a5fbad65a682225f7cfed8b78f2a2f by Christian Heimes in branch 'main': bpo-45020: Fix strict-prototypes warning (GH-29755) https://github.com/python/cpython/commit/5c4b19ec49a5fbad65a682225f7cfed8b78f2a2f --

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread Steve Dower
Steve Dower added the comment: Also, we should define $env:IncludeUWP="true" in the Windows PR tests. That will build extra binaries every time (that we ship in the Windows Store) and would catch this issue earlier. -- ___ Python tracker

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread Steve Dower
Steve Dower added the comment: Seems we lost the C++ handling in Include/cpython/initconfig.h: #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif -- keywords: +easy (C) versions: +Python 3.11 ___ Python tracker

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45893] Azure Pipelines currently failing

2021-11-24 Thread Guido van Rossum
New submission from Guido van Rossum : E.g. https://dev.azure.com/Python/cpython/_build/results?buildId=92084=results -- assignee: steve.dower components: Build messages: 406945 nosy: gvanrossum, steve.dower priority: high severity: normal status: open title: Azure Pipelines currently

[issue45822] Py_CompileString does not respect the coding cookie with the new parser if flags are empty

2021-11-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +27997 pull_request: https://github.com/python/cpython/pull/29759 ___ Python tracker ___

[issue45822] Py_CompileString does not respect the coding cookie with the new parser if flags are empty

2021-11-24 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset abfc794bbf2c6a0939ddd81b6e700c46944ba87a by Pablo Galindo Salgado in branch 'main': bpo-45822: Minor cleanups to the test_Py_CompileString test (GH-29750) https://github.com/python/cpython/commit/abfc794bbf2c6a0939ddd81b6e700c46944ba87a

[issue45822] Py_CompileString does not respect the coding cookie with the new parser if flags are empty

2021-11-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +27996 pull_request: https://github.com/python/cpython/pull/29758 ___ Python tracker ___

[issue45727] Parse error when missing commas is inconsistent

2021-11-24 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +27995 pull_request: https://github.com/python/cpython/pull/29757 ___ Python tracker ___

[issue45020] Freeze all modules imported during startup.

2021-11-24 Thread Christian Heimes
Change by Christian Heimes : -- nosy: +christian.heimes, christian.heimes, christian.heimes nosy_count: 24.0 -> 25.0 pull_requests: +27992, 27993, 27994 pull_request: https://github.com/python/cpython/pull/29755 ___ Python tracker

[issue45020] Freeze all modules imported during startup.

2021-11-24 Thread Christian Heimes
Change by Christian Heimes : -- nosy: +christian.heimes, christian.heimes nosy_count: 24.0 -> 25.0 pull_requests: +27992, 27993 pull_request: https://github.com/python/cpython/pull/29755 ___ Python tracker

[issue45020] Freeze all modules imported during startup.

2021-11-24 Thread Christian Heimes
Change by Christian Heimes : -- nosy: +christian.heimes nosy_count: 24.0 -> 25.0 pull_requests: +27992 pull_request: https://github.com/python/cpython/pull/29755 ___ Python tracker

[issue44391] PC/launcher.c,one more argument than required

2021-11-24 Thread Zachary Ware
Change by Zachary Ware : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, vinay.sajip, zach.ware versions: +Python 3.11 ___ Python tracker ___

[issue45881] Cross compiling on Linux is untested, undocumented, and broken

2021-11-24 Thread Christian Heimes
Change by Christian Heimes : -- pull_requests: +27991 pull_request: https://github.com/python/cpython/pull/29754 ___ Python tracker ___

[issue45881] Cross compiling on Linux is untested, undocumented, and broken

2021-11-24 Thread Christian Heimes
Change by Christian Heimes : -- pull_requests: +27990 pull_request: https://github.com/python/cpython/pull/29753 ___ Python tracker ___

[issue45616] Python Launcher Matches 3.10 instead of 3.1

2021-11-24 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the report, Gabe! We actually ran into this in the opposite direction as well; a system with 3.1 but not 3.10 started up 3.1 for `py -3.10` causing unexpected syntax errors. The fix is now merged and will be available with the release of v3.10.1

[issue45881] Cross compiling on Linux is untested, undocumented, and broken

2021-11-24 Thread Christian Heimes
Christian Heimes added the comment: New changeset b30bf4520ae9d6e7eca09d812dd8a86c020b9202 by Christian Heimes in branch 'main': bpo-45881: Use CC from env first for cross building (GH-29752) https://github.com/python/cpython/commit/b30bf4520ae9d6e7eca09d812dd8a86c020b9202 --

[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-24 Thread R. David Murray
R. David Murray added the comment: Your backward compatibility argument is persuasive. As you say, that means the BytesGenerate docs would need to be updated to note that that parameter is the exception to the rule for backward compatibility reasons. (If it is the only exception I have to

[issue45876] Improve accuracy of stdev functions in statistics

2021-11-24 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a reference for this use of round-to-odd: https://www.lri.fr/~melquion/doc/05-imacs17_1-expose.pdf I'm happy to provide any proofs that anyone feels are needed. -- ___ Python tracker

[issue43112] SOABI on Linux does not distinguish between GNU libc and musl libc

2021-11-24 Thread Henry Schreiner
Henry Schreiner added the comment: We had a call and have a potential path forward. Quick summary: * Add a patch on top of the current patch to make CPython look for `-gnu` on top of `-musl` for Alpine 3.15 and 3.14. Reverting the patch would break every Alpine wheel previously locally

[issue45892] Improve REPL with the underscore separators for int/float

2021-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: Oops, the float example should be: >>> 123123.9 123_123.9 -- ___ Python tracker ___ ___

[issue45892] Improve REPL with the underscore separators for int/float

2021-11-24 Thread Eric V. Smith
Eric V. Smith added the comment: We can't change the repr of int/float. However, you can use sys.displayhook to achieve what you want: import sys def displayhook(o): if o is None: return __builtins__._ = None if isinstance(o, (int, float)): print(format(o, '_'))

[issue17179] Misleading error from type() when passing unknown keyword argument

2021-11-24 Thread Irit Katriel
Irit Katriel added the comment: This seems to have been fixed by now. I get this on 3.11: >>> from types import new_class >>> from datetime import datetime >>> new_class('tdatetime', (datetime, ), kwds={'foo':'bar'}) Traceback (most recent call last): File "", line 1, in File

[issue3232] Wrong str->bytes conversion in Lib/encodings/idna.py

2021-11-24 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.11 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45881] Cross compiling on Linux is untested, undocumented, and broken

2021-11-24 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +27989 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29752 ___ Python tracker

[issue45881] Cross compiling on Linux is untested, undocumented, and broken

2021-11-24 Thread Christian Heimes
Christian Heimes added the comment: bpo-45886 addresses the cross build issue with freeze_module command. The wrong header files come from the fact that setup.py uses CC variable from sysconfig instead of environment. The sysconfig variable contains the C compiler of the build interpreter

[issue45892] Improve REPL with the underscore separators for int/float

2021-11-24 Thread Alex
New submission from Alex : I often use to the Python REPL to perform some simple calculations (typically some combinatorial or probabilities computation). I believe it would be a nice improvement if the number displayed in the REPL would be formatted as if f"{result:_}" was given (with the

[issue45760] Remove "PyNumber_InMatrixMultiply"

2021-11-24 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch nosy: +corona10 nosy_count: 3.0 -> 4.0 pull_requests: +27988 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29751 ___ Python tracker

[issue45822] Py_CompileString does not respect the coding cookie with the new parser if flags are empty

2021-11-24 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +27987 pull_request: https://github.com/python/cpython/pull/29750 ___ Python tracker ___

[issue45891] bool variable isinstance of int

2021-11-24 Thread noobie1000
Change by noobie1000 : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45891] bool variable isinstance of int

2021-11-24 Thread noobie1000
noobie1000 added the comment: Hello Steven, Sorry, this is my first ever post and was lost in the enormity of issues/documentation. Noted your points :) Thank you. -- resolution: not a bug -> status: closed -> open ___ Python tracker

[issue45891] bool variable isinstance of int

2021-11-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi noobie1000, This is not a general forum for asking questions about Python's design or language, this is for reporting bugs. There are many forums where you can ask "Why" questions and ask for the community to "shed some light on this", such as

[issue45889] pathlib: Path.match does not work on paths

2021-11-24 Thread Nick Papior
Nick Papior added the comment: Thanks for the discussion. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45885] Specialize COMPARE_OP

2021-11-24 Thread Mark Shannon
Mark Shannon added the comment: Is COMPARE_OP worth specializing by itself? Most comparisons are followed by a jump, and much of the overhead is in the branching around the choice of operator as well as pushing and popping (with inc/decrefs) a value that has only one bit of information

[issue45891] bool variable isinstance of int

2021-11-24 Thread Christian Heimes
Christian Heimes added the comment: This is the expected behavior. The bool type is a subtype of int. True is int 1 in disguise and False is int 0. >>> bool.__mro__ (, , ) >>> True == 1 True >>> True == 2 False >>> False == 0 True -- nosy: +christian.heimes

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-11-24 Thread Christoph Groth
Christoph Groth added the comment: > What concrete action would you propose that the Python core devs take at this > point? Nothing for now. I stumbled across this issue through https://gitlab.kwant-project.org/kwant/tinyarray/-/issues/20 and had the impression that the aspect that I

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-11-24 Thread Mark Dickinson
Mark Dickinson added the comment: Just for fun: I gave a somewhat ranty 10-minute talk on this topic at a (virtual) conference a few months ago: https://www.youtube.com/watch?v=01oeosRVwgY -- ___ Python tracker

[issue45891] bool variable isinstance of int

2021-11-24 Thread noobie1000
New submission from noobie1000 : Hello, Recently I observed that isinstance(x, int) returns True, even when x is defined as a bool. While I understand that internally, a bool is treated as an int with values 0 and 1; to me, this is a bit misleading that the python interpreter returns True

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-11-24 Thread Mark Dickinson
Mark Dickinson added the comment: @cwg: Yep, we're aware of this. There are no good solutions here - only a mass of constraints, compromises and trade-offs. I think we're already somewhere on the Pareto boundary of the "best we can do" given the constraints. Moving to another point on the

[issue45889] pathlib: Path.match does not work on paths

2021-11-24 Thread Ronald Oussoren
Ronald Oussoren added the comment: I don't think our opinions about this will converge, I'm therefore leaving this discussion. >> would ``Path("dir/some.py").match(Path("*.py"))`` return? > > str(Path("*.py")) == "*.py" > > So no problems here. I do think this is a problem, treating a Path

[issue45889] pathlib: Path.match does not work on paths

2021-11-24 Thread Nick Papior
Nick Papior added the comment: It basically checks that some part of the path is the same as some part of a reference path, they need not have the same complete parent which is why the resolve command would negate this comparison always. -- As for your last example, that will be quite

[issue45889] pathlib: Path.match does not work on paths

2021-11-24 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm not sure what your code tries to accomplish, does it check that ``f.parent`` refers to the same location as ``ref_file``? A clearer solution for that would be ``f.parent.resolve() == ref_file.resolve()``. The argument to match, glob and rglob

[issue25066] Better repr for multiprocessing.synchronize objects

2021-11-24 Thread Kumar Aditya
Change by Kumar Aditya : -- keywords: +patch nosy: +kumaraditya303 nosy_count: 7.0 -> 8.0 pull_requests: +27986 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/29749 ___ Python tracker

[issue32082] atexit module: allow getting/setting list of handlers directly

2021-11-24 Thread Irit Katriel
Irit Katriel added the comment: Yes, I agree this should be closed as a duplicate of issue17186. The shortcut for updating the list of handlers is not really necessary because the API already allows you to do this. -- resolution: -> duplicate stage: -> resolved status: open ->

[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-11-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +27985 pull_request: https://github.com/python/cpython/pull/29748 ___ Python tracker ___

[issue45889] pathlib: Path.match does not work on paths

2021-11-24 Thread Nick Papior
Nick Papior added the comment: > Because of this I don't agree with your idea that anything that can match a > path is a sub-path. Why not? If a match is True, it means that what is matched must be some kind of valid path matching a glob specification. Whether it is a regular expression,

[issue45889] pathlib: Path.match does not work on paths

2021-11-24 Thread Ronald Oussoren
Ronald Oussoren added the comment: Match doesn't match paths, but basically does a regular expression match on the textual representation (using glob syntax instead of normal regular expression syntax). Because of this I don't agree with your idea that anything that can match a path is a

[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-24 Thread Christian Heimes
Change by Christian Heimes : -- pull_requests: +27984 pull_request: https://github.com/python/cpython/pull/29747 ___ Python tracker ___

[issue45890] Add tests for tracing try-except-finally blocks

2021-11-24 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch pull_requests: +27983 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29746 ___ Python tracker ___

[issue45890] Add tests for tracing try-except-finally blocks

2021-11-24 Thread Irit Katriel
Change by Irit Katriel : -- assignee: iritkatriel components: Interpreter Core, Tests nosy: iritkatriel priority: normal severity: normal status: open title: Add tests for tracing try-except-finally blocks type: enhancement versions: Python 3.11 ___

[issue45509] Gzip header corruption not properly checked.

2021-11-24 Thread Ruben Vorderman
Ruben Vorderman added the comment: I have found that using the timeit module provides more precise measurements: For a simple gzip header. (As returned by gzip.compress or zlib.compress with wbits=31) ./python -m timeit -s "import io; data =

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-11-24 Thread Christoph Groth
Christoph Groth added the comment: Hello. I would like to point out a possible problem that this change to CPython has introduced. This change looks innocent, but it breaks the unwritten rule that the hash value of a number (or actually any built-in immutable type!) in Python depends only

[issue45889] pathlib: Path.match does not work on paths

2021-11-24 Thread Nick Papior
Nick Papior added the comment: Ok, I see this a feature. :) As for why it is desirable. A part of a path is still a path, and matching for something must mean that you are matching a partial path. Even if you use '*.py' as the pattern this would still make sense as a path: path =

[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2021-11-24 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +27982 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/29745 ___ Python tracker ___

[issue22045] Python make issue

2021-11-24 Thread Christian Heimes
Christian Heimes added the comment: Python 2 is no longer supported. Can you reproduce the issue with Python 3.9 or newer? -- nosy: +christian.heimes ___ Python tracker ___

  1   2   >