[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think we should stick the with forward slashes. That is what the rest of the language does. Adding more options is recipe for confusion. >>> 38 / 5 7.6 >>> 38 ∕ 5 SyntaxError: invalid character '∕' (U+2215) -- nosy: +rhettinger ___

[issue43502] [C-API] Convert obvious unsafe macros to static inline functions

2021-03-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Be careful about performance. We know for sure that macros will inline. In contrast, inline functions might or might not inline (there are rules for when it can be done). When applied across source files, inlining often only occurs with an LTO build — a

[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2021-03-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Shouldn't this wait to see if the subinterpreters PEP is approved? Because if it isn't, then no chance should be made. We shouldn't change something this fundamental without good cause. -- nosy: +pablogsal, rhettinger __

[issue43524] Addition of peek and peekexactly methods to asyncio.StreamReader

2021-03-16 Thread Awal Garg
New submission from Awal Garg : I propose the addition of the following methods to asyncio.StreamReader: > coroutine peek(n=-1) > Same as read, but does not remove the returned data from the internal buffer. > > coroutine peekexactly(n) > Same as readexactly, but does not remove the returned d

[issue43523] Handling Ctrl+C while waiting on I/O in Windows

2021-03-16 Thread Eryk Sun
Eryk Sun added the comment: winrshost.exe runs Python with its standard I/O redirected to pipes, so sys.stdin.read(1) blocks the main thread while waiting for the synchronous read to complete. If the user types something, then the read completes and the main thread can call the SIGINT handle

[issue43516] python on raspberry pi

2021-03-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Yann, Eric is correct -- this isn't a help desk. Please ask your question on one of the many forums available for asking help, but before you do, please read: http://www.sscce.org/ https://stackoverflow.com/help/minimal-reproducible-example and remember t

[issue43524] Addition of peek and peekexactly methods to asyncio.StreamReader

2021-03-16 Thread Awal Garg
Awal Garg added the comment: P.S., I've filed this issue after a brief discussion in #python and following this ticket https://bugs.python.org/issue32052 which asks for exposing the internal buffer as is. Obviously, peek methods don't need to expose the buffer and only provide a readonly vie

[issue43502] [C-API] Convert obvious unsafe macros to static inline functions

2021-03-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I agree we should be careful here. There are several things to consider: * Macros transformed into function may or may not get inlined so there is a risk of affecting performance if we just transform them in bulk. * Because the macro is defined as 'st

[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: PEP 626 deprecates co_lnotab, co_lnotab: https://www.python.org/dev/peps/pep-0626/#id15 This doesn't seem to be mentioned in the What's new document and is quite important. Mark, do you mind creating a PR for this? I could do it and add you as a revi

[issue43497] SyntaxWarning for "assertion is always true, perhaps remove parentheses?" does not work with constants

2021-03-16 Thread Greg Darke
Change by Greg Darke : -- resolution: -> fixed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue43477] from x import * behavior inconsistent between module types.

2021-03-16 Thread Thomas J. Gallen
Thomas J. Gallen added the comment: Given the previous example, in test.py, replace: ``` print(test_module.test_submodule) ``` ...with: ``` assert(not hasattr(test_module, "test_submodule")) ``` ...because the issue is only the bottom half of `_find_and_load_unlocked`. Specifically, the ch

[issue15533] subprocess.Popen(cwd) documentation: Posix vs Windows

2021-03-16 Thread Eryk Sun
Eryk Sun added the comment: > Python is conceptually multi-platform, so its behavior on > Linux and Windows should be as much consistent as possible. It's not expected for the behavior of all Popen() parameters to be the same on all platforms. For example, the behavior and capabilities of sh

[issue15533] subprocess.Popen(cwd) documentation: Posix vs Windows

2021-03-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: For our subprocess docs, Eryk's text: """ For POSIX, ``executable`` should be stated as a "relative path without a slash in it" or a "relative path without a directory in it". An unqualified filename is a relative path that won't be resolved against ``cwd`

[issue43525] pathlib: Highlight operator behavior with anchored paths

2021-03-16 Thread diegoe
New submission from diegoe : In the '/' operator documentation for `pathlib`, the behavior for anchored paths is not described: https://docs.python.org/3/library/pathlib.html#operators The behavior (prefer the second/right-hand root/anchor) is only explained in the `PurePath` class: https:/

[issue43511] tkinter with Tk 8.6.11 is slow on macOS

2021-03-16 Thread Ned Deily
Ned Deily added the comment: Thanks for submitting a very interesting issue! tkinter/Tk performance is not something we normally pay a lot of attention to. I did not attempt to run your application but I was able to see significant performance differences with your simple "help('modules') te

[issue43525] pathlib: Highlight operator behavior with anchored paths

2021-03-16 Thread diegoe
Change by diegoe : -- keywords: +patch pull_requests: +23664 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24900 ___ Python tracker ___ _

[issue43525] pathlib: Highlight pathlib operator behavior with anchored paths

2021-03-16 Thread diegoe
Change by diegoe : -- title: pathlib: Highlight operator behavior with anchored paths -> pathlib: Highlight pathlib operator behavior with anchored paths ___ Python tracker __

[issue38890] subprocess.Popen should not emit a ResourceWarning for a detached process

2021-03-16 Thread Eryk Sun
Eryk Sun added the comment: I wonder if this should be handled more productively by supporting a `daemon` parameter. In POSIX, use the double fork technique for creating a daemon process. In Windows, use DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP | CREATE_BREAKAWAY_FROM_JOB. For a daemon pr

[issue32553] Use the py launcher in venv Windows examples

2021-03-16 Thread Eryk Sun
Change by Eryk Sun : -- title: venv says to use python3 which does not exist in 3.6.4 -> Use the py launcher in venv Windows examples versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker

[issue43522] SSLContext.hostname_checks_common_name appears to have no effect

2021-03-16 Thread Quentin Pradet
Quentin Pradet added the comment: Thank you for the quick fix! 🙏 Both the reproducer and the urllib3 test suite run fine with this change. However, we can't trust `HAS_NEVER_CHECK_COMMON_NAME` anymore, because it will be True in Python versions where `hostname_checks_common_name` does not wor

[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-16 Thread Paul
Paul added the comment: That's the very first issue I've reported in bugs.python.org and I'm completely new to the Python dev process: I have some further remarks at the issue (especially about consistency with the current treatment of Protocols vs. ABCs). Will they be read if placed here a

[issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking

2021-03-16 Thread Antti Haapala
Change by Antti Haapala : -- title: functools.cached_property locking is plain wrong. -> functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking ___ Python tracker

[issue27602] Enable py launcher to launch repository Python.

2021-03-16 Thread Eryk Sun
Eryk Sun added the comment: The narrow scope of this issue could be implemented by defining a scheme for local builds in the PythonCore key -- such as "X.Ys[-32]". The build process would create or update the "HKCU\Software\Python\PythonCore\X.Ys[-32]\InstallPath" key with the "ExecutablePa

<    1   2