[issue43420] Optimize rational arithmetics

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: > 1 loop, best of 11: 257 msec per loop > $ ... from patched ... > 10 loops, best of 11: 33.2 msec per loop Looks worth it :-) -- ___ Python tracker

[issue41361] Converting collections.deque methods to Argument Clinic

2021-03-06 Thread Dennis Sweeney
Dennis Sweeney added the comment: If the argument clinic is too disruptive, would it be okay to inline the equivalent code like this? diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 90bafb0ea8..d75388abc8 100644 --- a/Modules/_collectionsmodule.c +++

[issue43405] DeprecationWarnings in test_unicode

2021-03-06 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue43405] DeprecationWarnings in test_unicode

2021-03-06 Thread Inada Naoki
Inada Naoki added the comment: New changeset 8aabfa8550692a76d8a96e138c48faf5a7b2752c by Zackery Spytz in branch 'master': bpo-43405: Fix DeprecationWarnings in test_unicode (GH-24754) https://github.com/python/cpython/commit/8aabfa8550692a76d8a96e138c48faf5a7b2752c --

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Aaron Meurer
Change by Aaron Meurer : -- nosy: +asmeurer ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41282] Deprecate and remove distutils

2021-03-06 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I have created below issues where deprecation warning is emitted due to distutils usage in tests. Probably there are other places that need an update to setuptools like setup.py used by make that emits deprecation warning during building cpython.

[issue43426] test_importlib.test_windows emits deprecation warning over usage of distutils

2021-03-06 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : test_windows uses distutil which emits a deprecation warning due to distutils being deprecated. sysconfig.get_platform and distutils.util.get_host_platform seem to be identical though distutils.util.get_platform has an extra if clause for nt

[issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils

2021-03-06 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : distutils was deprecated for removal in Python 3.10. It is used in test_peg_generator.test_c_parser which emits a deprecation warning. It also seems to be used in test_support for missing_compiler_executable that will emit a deprecation warning.

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Sergey B Kirpichev
Change by Sergey B Kirpichev : -- pull_requests: +23544 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24779 ___ Python tracker ___

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Sergey B Kirpichev
Sergey B Kirpichev added the comment: I have similar timings (for a draft version of PR, see f.patch) as for the last comment, though the small-dens overhead seems to be bigger(~20%): $ python3.10 -m timeit -r11 -s 'from fractions import Fraction as F' -s 'a=F(10,3)' -s 'b=F(6, 5)' 'a * b'

Re: Apriori Algorithm

2021-03-06 Thread Paul Bryan
Google tells me this: https://github.com/tommyod/Efficient-Apriori On Sat, 2021-03-06 at 18:46 -0800, sarang shah wrote: > I want to make apriori algorithm from start. Anybody have any > reference file? -- https://mail.python.org/mailman/listinfo/python-list

RE: Apriori Algorithm

2021-03-06 Thread Avi Gross via Python-list
"I want to make apriori algorithm from start. Anybody have any reference file?" Excellent question. Based on everything you shared, I think all I can offer is that whatever you do, do not make the aposteriori version. Or, you could consider asking a real question with enough detail that

Re: pygame errors

2021-03-06 Thread MRAB
On 2021-03-07 03:01, Quentin Bock wrote: #Space Invaders! #Title and Icon pygame.display.set_caption("Space Invaders") icon = pygame.image.load('space-invaders.png') pygame.display.set_icon(icon) #Player player_Image = pygame.image.load('player.png') player_X = 370 player_Y = 480 def player():

[issue25024] Allow passing "delete=False" to TemporaryDirectory

2021-03-06 Thread C.A.M. Gerlach
C.A.M. Gerlach added the comment: To note, the proposal on [BPO-29982](https://bugs.python.org/issue29982) should hopefully address one of the two use-cases described by Anthony Sotittle, `ignore_errors=True`, in a cleaner fashion that takes advantage of the existing higher-level

[issue29982] tempfile.TemporaryDirectory fails to delete itself

2021-03-06 Thread C.A.M. Gerlach
C.A.M. Gerlach added the comment: In addition to transient failures, this can also occur when, for example, files opened in the temporary directory (perhaps by library or application code not under direct control of the caller) haven't been properly cleaned up and their file handles don't

pygame errors

2021-03-06 Thread Quentin Bock
#Space Invaders! #Title and Icon pygame.display.set_caption("Space Invaders") icon = pygame.image.load('space-invaders.png') pygame.display.set_icon(icon) #Player player_Image = pygame.image.load('player.png') player_X = 370 player_Y = 480 def player(): screen.blit(player_Image, player_X,

Apriori Algorithm

2021-03-06 Thread sarang shah
I want to make apriori algorithm from start. Anybody have any reference file? -- https://mail.python.org/mailman/listinfo/python-list

[issue43424] Document the `controller.name` field in `webbrowser` module

2021-03-06 Thread Ilya Grigoriev
New submission from Ilya Grigoriev : The object `webbrowser.get()` returns has, and had for a long time, a useful but undocumented field `name`. I wonder if it would be OK to document it as something like `a system-dependent name for the browser`. This would go here:

[issue40982] copytree example in shutil

2021-03-06 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch nosy: +ZackerySpytz nosy_count: 3.0 -> 4.0 pull_requests: +23543 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24778 ___ Python tracker

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Chris Angelico
On Sun, Mar 7, 2021 at 9:42 AM Mirko via Python-list wrote: > I even wonder why they have tried. Writing a universal > compiler/interpreter sounds logically impossible to me, Here's a > simple Python expression: > > >>> 3+3*5 > 18 > > And here's the same expression in (GNU) Smalltalk: > > st>

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Mirko via Python-list
Am 06.03.2021 um 22:24 schrieb Ben Bacarisse: > Mr Flibble writes: > >>> Someone who says that he is capable of writing a compiler that >>> translates every language has megalomania. No one can do this. >> >> Just because you can't make one it doesn't follow that nobody else >> can. > > True,

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Chris M. Thomasson
On 3/5/2021 8:51 AM, Mr Flibble wrote: neonumeric - C++ arbitrary precision arithmetic library with arbitrary precision integers, floats and rationals: https://github.com/i42output/neonumeric It hasn't been formally released yet as it still requires more extensive testing.  It will be used

RE: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Avi Gross via Python-list
Just to be clear, and luckily the person who posed such boasts is luckily gone and I AM NOT interested in having the discussion again here, I have a point to make. He did not suggest a magical compiler that could translate any language. Not exactly. I think he suggested that if all languages

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

2021-03-06 Thread Neil Schemenauer
Neil Schemenauer added the comment: New changeset 87ec26b812e9c4095c017dc60f246eda37b83ab2 by Neil Schemenauer in branch 'master': bpo-43372: Use _freeze_importlib for regen-frozen. (GH-24759) https://github.com/python/cpython/commit/87ec26b812e9c4095c017dc60f246eda37b83ab2 --

[issue43372] ctypes: test_frozentable fails when make regen-frozen

2021-03-06 Thread Neil Schemenauer
Change by Neil Schemenauer : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue43372] ctypes: test_frozentable fails when make regen-frozen

2021-03-06 Thread Neil Schemenauer
Neil Schemenauer added the comment: New changeset 87ec26b812e9c4095c017dc60f246eda37b83ab2 by Neil Schemenauer in branch 'master': bpo-43372: Use _freeze_importlib for regen-frozen. (GH-24759) https://github.com/python/cpython/commit/87ec26b812e9c4095c017dc60f246eda37b83ab2 --

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Ben Bacarisse
Mr Flibble writes: >> Someone who says that he is capable of writing a compiler that >> translates every language has megalomania. No one can do this. > > Just because you can't make one it doesn't follow that nobody else > can. True, but lots of very knowledgeable people have tried and failed.

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Chris M. Thomasson
On 3/6/2021 11:35 AM, Mr Flibble wrote: On 06/03/2021 19:11, Bonita Montero wrote: There is no projection. _You_ have megalomania, not me. And there's also no Dunning Kruger effect. You can't assess your capabilites, not me. no u Someone who says that he is capable of writing a compiler

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Without the guards the incremental cost drops to 10%. $ python3.10 -m timeit -r11 -s 'from patched_noguards import Fraction as F' -s 'a=F(10,3)' -s 'b=F(6, 5)' 'a * b' 10 loops, best of 11: 2.02 usec per loop --

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: The cost to the common case for small components is about 20%: $ python3.10 -m timeit -r11 -s 'from fractions import Fraction as F' -s 'a=F(10,3)' -s 'b=F(6, 5)' 'a * b' 20 loops, best of 11: 1.8 usec per loop $ python3.10 -m timeit -r11 -s 'from

[issue43216] Removal of @asyncio.coroutine in Python 3.10

2021-03-06 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +graingert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43423] Subprocess IndexError possible in _communicate

2021-03-06 Thread Eryk Sun
Eryk Sun added the comment: The presumption I suppose is that these statements only execute if self.stdout_thread and/or self.stderr_thread completes successfully. I suppose that the read could fail or get canceled via CancelSynchronousIo(). Of course in that case you have a bigger problem

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Note that Fraction arithmetic has a huge administrative overhead. The cost of the underlying multiplications and divisions won't dominate the total time until the numerators and denominators are very large. For the proposed optimization, this implies

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Bonita Montero
There is no projection. _You_ have megalomania, not me. And there's also no Dunning Kruger effect. You can't assess your capabilites, not me. no u Someone who says that he is capable of writing a compiler that translates every language has megalomania. No one can do this. --

[issue43423] Subprocess IndexError possible in _communicate

2021-03-06 Thread Chris Griffith
Change by Chris Griffith : -- keywords: +patch pull_requests: +23542 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24777 ___ Python tracker ___

[ANN] managesieve 0.7

2021-03-06 Thread Hartmut Goebel
Announcing: managesieve 0.7     ManageSieve client library for remotely managing Sieve scripts,     including an user application (the interactive 'sieveshell'). :Homepage: https://managesieve.readthedocs.io/ :Author:   Hartmut Goebel :License:   - for the managesieve module:

[ANN] python-ghostscript 0.7

2021-03-06 Thread Hartmut Goebel
Announcing:      python-ghostscript 0.7    A Python-Interface to the Ghostscript                  C-API using ctypes :License: GNU General Public License v3 or later (GPLv3+) :Author:  Hartmut Goebel :Homepage: https://gitlab.com/pdftools/python-ghostscript :Download:

[issue43423] Subprocess IndexError possible in _communicate

2021-03-06 Thread Chris Griffith
New submission from Chris Griffith : It is possible to run into an IndexError in the subprocess module's _communicate function. ``` return run( File "subprocess.py", line 491, in run File "subprocess.py", line 1024, in communicate File "subprocess.py", line 1418, in _communicate

[issue43245] Add keyword argument support to ChainMap.new_child()

2021-03-06 Thread Kamil Turek
Change by Kamil Turek : -- nosy: +kamilturek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Chris Angelico
On Sun, Mar 7, 2021 at 4:51 AM Bonita Montero wrote: > > > Whilst you need to read the following: > > * https://en.wikipedia.org/wiki/Psychological_projection > > * https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect > > There is no projection. > _You_ have megalomania, not me. > And

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Bonita Montero
Whilst you need to read the following: * https://en.wikipedia.org/wiki/Psychological_projection * https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect There is no projection. _You_ have megalomania, not me. And there's also no Dunning Kruger effect. You can't assess your capabilites, not

[issue37771] No equivalent of `inspect.getcoroutinestate` for PyAsyncGenASend instances

2021-03-06 Thread Thomas Grainger
Change by Thomas Grainger : -- nosy: +alex.gronholm, graingert ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here's some code to try out: from math import gcd from fractions import Fraction import operator import math class Henrici(Fraction): 'Reformulate _mul to reduce the size of intermediate products' # Original has 2 multiplications, 1 gcd calls,

[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2021-03-06 Thread Eryk Sun
Eryk Sun added the comment: The solution for bpo-36779 changed init_timezone() to get tzname directly from WinAPI GetTimeZoneInformation(). Unfortunately the implementer didn't think to also support time.tzset(), so the value may be stale with no way to refresh it, or possibly different

[issue43422] Revert _decimal C API changes

2021-03-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 fron me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30295] msvcrt SetErrorMode not documented

2021-03-06 Thread Eryk Sun
Change by Eryk Sun : -- components: +Library (Lib) type: -> enhancement versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

[issue14841] os.get_terminal_size() should check stdin as a fallback

2021-03-06 Thread Eryk Sun
Change by Eryk Sun : -- components: +Extension Modules, Library (Lib) versions: +Python 3.10, Python 3.9 -Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

[issue43413] tuple subclasses allow kwargs

2021-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Hmm, but in my experience, tuple on Python 3.6 doesn't take keyword arguments > either: They do. >>> tuple(sequence='abc') ('a', 'b', 'c') >>> list(sequence='abc') ['a', 'b', 'c'] >>> int(x='123') 123 >>> bool(x='123') True >>> float(x='123') 123.0 It

[issue41369] Update to libmpdec-2.5.1

2021-03-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Stefan wrote me that the changes which complete this update are here: https://github.com/python/cpython/compare/master...skrah:libmpdec-2.5.1 I can turn this diff into a PR but first I want to gather feedback here. Mark, Serhiy, Raymond, what do you say?

[issue43422] Revert _decimal C API changes

2021-03-06 Thread Antoine Pitrou
New submission from Antoine Pitrou : Stefan Krah (who doesn't have access rights here, and is the author of the C _decimal module) asked me to transmit me this request: """ The capsule API does not meet my testing standards, since I've focused on the upstream mpdecimal in the last couple of

[issue43332] Make http.client._tunnel send one byte string over the network

2021-03-06 Thread Zveinn
Zveinn added the comment: Hey! First of all, thank you for not shitting all over me <3 I have never really used python and the only reason I found this is because I was developing a tool that accepted a LOT of CONNECT requests for python and I just happened to stumble upon this little

[issue43406] Possible race condition between signal catching and signal.signal

2021-03-06 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue43406] Possible race condition between signal catching and signal.signal

2021-03-06 Thread miss-islington
miss-islington added the comment: New changeset 1385f8355a036fd65aaf9c7e7ab48467ca922bcf by Miss Islington (bot) in branch '3.9': [3.9] bpo-43406: Fix possible race condition where ``PyErr_CheckSignals`` tries to execute a non-Python signal handler (GH-24756) (GH-24761)

[issue43406] Possible race condition between signal catching and signal.signal

2021-03-06 Thread miss-islington
miss-islington added the comment: New changeset 4715be8a4384159e47fb09e5f3bd077734842655 by Antoine Pitrou in branch '3.8': [3.8] bpo-43406: Fix possible race condition where ``PyErr_CheckSignals`` tries to execute a non-Python signal handler (GH-24756) (GH-24762)

Re: Choosable dependency

2021-03-06 Thread Manfred Lotz
On Sat, 6 Mar 2021 14:06:27 +0100 Peter Otten <__pete...@web.de> wrote: > On 06/03/2021 12:43, Manfred Lotz wrote: > > On Sat, 6 Mar 2021 12:00:33 +0100 > > Manfred Lotz wrote: > > > >> Let us say I have a package which reads a TOML file. > >> > >> I want to give the user of my package the

[issue43419] contextvars does not work properly in asyncio REPL.

2021-03-06 Thread Lanfon
Change by Lanfon : -- keywords: +patch pull_requests: +23541 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24773 ___ Python tracker ___

[issue43421] os.device_encoding(fd) should support any console fd in Windows

2021-03-06 Thread Eryk Sun
New submission from Eryk Sun : In Windows, os.device_encoding() is hard coded to map file descriptor 0 and descriptors 1 and 2 respectively to the console's input and output code page if isatty(fd) is true. But isatty() is true for any character device, such as "NUL". Also any fd might be a

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Bonita Montero
It hasn't been formally released yet as it still requires more extensive testing. It will be used as part of my universal compiler, neos, that can compile any programming language ... You will get the same room in the same psychiatric ward like Amine Moulay Ramdane. --

[issue43420] Optimize rational arithmetics

2021-03-06 Thread Sergey B Kirpichev
New submission from Sergey B Kirpichev : fractions.py uses naive algorithms for doing arithmetics. It may worth implementing less trivial versions for addtion/substraction and multiplication (e.g. Henrici algorithm and so on), described here:

[issue43419] contextvars does not work properly in asyncio REPL.

2021-03-06 Thread Lanfon
New submission from Lanfon : Demonstration (via python -m asyncio): asyncio REPL 3.9.0 (default, Oct 18 2020, 00:21:26) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Use "await" directly instead of "asyncio.run()". Type "help", "copyright", "credits" or "license" for more information. >>>

[issue43418] FTPLib module crashes when server returns byte message instead of string

2021-03-06 Thread Hugo Chia
New submission from Hugo Chia : https://github.com/cowrie/cowrie/issues/1394 https://github.com/cowrie/cowrie/pull/1396 Above are some of the links mentioning the issue with the FTPLib module. It happens when the FTP server returns a byte message instead of a string. Ftplib expects a string

Re: Choosable dependency

2021-03-06 Thread Peter Otten
On 06/03/2021 12:43, Manfred Lotz wrote: On Sat, 6 Mar 2021 12:00:33 +0100 Manfred Lotz wrote: Let us say I have a package which reads a TOML file. I want to give the user of my package the choice to decide if he wants to use the toml, tomlkit or rtoml package. So, in case the user chose to

[issue43391] The comments have invalid license information (broken Python 2.4 URL for Python 3)

2021-03-06 Thread Marc-Andre Lemburg
Change by Marc-Andre Lemburg : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue43417] ast.unparse: Simplify buffering logic

2021-03-06 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- keywords: +patch pull_requests: +23540 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24772 ___ Python tracker ___

[issue43417] ast.unparse: Simplify buffering logic

2021-03-06 Thread Batuhan Taskaya
New submission from Batuhan Taskaya : Currently, buffer is just an instance-level list that is used in various places to avoid directly writing stuff into the real source buffer, though the design is pretty complicated and hard to use. There are various use cases (like omitting the empty

Re: Choosable dependency

2021-03-06 Thread Manfred Lotz
On Sat, 6 Mar 2021 12:00:33 +0100 Manfred Lotz wrote: > Let us say I have a package which reads a TOML file. > > I want to give the user of my package the choice to decide if he wants > to use the toml, tomlkit or rtoml package. > > So, in case the user chose to use rtoml then there should

Choosable dependency

2021-03-06 Thread Manfred Lotz
Let us say I have a package which reads a TOML file. I want to give the user of my package the choice to decide if he wants to use the toml, tomlkit or rtoml package. So, in case the user chose to use rtoml then there should be an import only for rtoml, aso. How could I achieve this? --

[issue43415] Typo

2021-03-06 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42128] Structural Pattern Matching (PEP 634)

2021-03-06 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- pull_requests: +23539 pull_request: https://github.com/python/cpython/pull/24771 ___ Python tracker ___

[issue43416] Add README files in Include/cpython and Include/internal

2021-03-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : I always hesitate in what subdirectory of Include/ to add a declaration of new private API. What is more "private"? It would be nice to add README files in these directories which describe what API should be declared here and what is the difference