[issue45268] use multiple "in" in one expression?

2021-09-22 Thread zeroswan
New submission from zeroswan : I find it's a valid expression: `1 in [1, 2, 3] in [4, 5, 6]` `a in b in c` is equivalent to `a in b and b in c` but this expression seems useless, and easy to confused with (a in b) in c . in this program, what I originally want is `if a in b and a in c` , But

[issue45026] More compact range iterator

2021-09-22 Thread Dennis Sweeney
Dennis Sweeney added the comment: I benchmarked GH-27986 and GH-28176 on "for i in range(1): pass" and found that GH-27986 was faster for this (likely most common) case of relatively small integers. Mean +- std dev: [main] 204 us +- 5 us -> [GH-27986] 194 us +- 4 us: 1.05x faster Mean

Re: XML Considered Harmful

2021-09-22 Thread Dennis Lee Bieber
On Wed, 22 Sep 2021 09:52:59 -0500, "Michael F. Stemper" declaimed the following: >On 21/09/2021 19.30, Eli the Bearded wrote: >> In comp.lang.python, Michael F. Stemper wrote: >>> How does CSV handle hierarchical data? For instance, I have >>> generators[1], each of which has a name, a fuel

[issue45020] Freeze all modules imported during startup.

2021-09-22 Thread Gregory Szorc
Gregory Szorc added the comment: I'll throw out that __file__ is strictly optional, per https://docs.python.org/3/reference/datamodel.html. IMO it is more important to define importlib.abc.InspectLoader than __file__ (so tracebacks have source context). Given that __file__ is optional,

[issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful

2021-09-22 Thread Jeremy Maitin-Shepard
Jeremy Maitin-Shepard added the comment: I suppose calling `Py_Initialize`, `Py_FinalizeEx`, then `Py_Initialize` again, then `Py_FinalizeEx` again in an embedding application, was already not particularly well supported, since it would leak memory. However, with this change it also leaks

[issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful

2021-09-22 Thread Gregory P. Smith
Gregory P. Smith added the comment: I believe jbms is right that pausing the threads is the only right thing to do when they see tstate_must_exit. The PR is likely correct. -- versions: +Python 3.11, Python 3.9 ___ Python tracker

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-09-22 Thread Benjamin Szőke
Change by Benjamin Szőke : -- pull_requests: +26917 pull_request: https://github.com/python/cpython/pull/28526 ___ Python tracker ___

[issue45234] copy_file raises FileNotFoundError when src is a directory

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Cherry-picked! -- priority: release blocker -> stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45267] New install Python 3.9.7 install of Sphinx Document Generator fails

2021-09-22 Thread Paul Broe
New submission from Paul Broe : Brand new build of Python 3.9.7 on RHEL 7. Placed in /usr/local/python3 Created new python environment cd /usr/opt/oracle/ python3 -m venv py3-sphinx source /usr/opt/oracle/py3-sphinx/bin/activate Now verify that python is now linked to Python 3. In this

[issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful

2021-09-22 Thread Jeremy Maitin-Shepard
Change by Jeremy Maitin-Shepard : -- keywords: +patch pull_requests: +26916 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28525 ___ Python tracker

[issue39549] The reprlib.Repr type should permit the “fillvalue” to be set by the user

2021-09-22 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39549] The reprlib.Repr type should permit the “fillvalue” to be set by the user

2021-09-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 8c21941ddafdf4925170f9cea22e2382dd3b0184 by Alexander Böhn in branch 'main': bpo-39549: reprlib.Repr uses a “fillvalue” attribute (GH-18343) https://github.com/python/cpython/commit/8c21941ddafdf4925170f9cea22e2382dd3b0184 --

[issue43976] Allow Python distributors to add custom site install schemes

2021-09-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: Here's what I propose: 1. In pypa/distutils, add support for honoring the proposed install schemes (based on PR 25718). Merge with Setuptools. 2. Add whatever ugly hacks are needed to pypa/distutils to honor other Debian-specific behaviors (revive

[issue45262] crash if asyncio is used before and after re-initialization if using python embedded in an application

2021-09-22 Thread Andrew Svetlov
Andrew Svetlov added the comment: I guess the fix requires switching C Extension types from static to heap for _asyncio module. It is possible for sure but requires a non-trivial amount of work. We need a champion for the issue. -- ___ Python

Re: Polymorphic imports

2021-09-22 Thread Chris Angelico
On Thu, Sep 23, 2021 at 4:20 AM Dennis Lee Bieber wrote: > > The other alternative may be > https://docs.python.org/3/library/functions.html#__import__ > I wouldn't recommend calling a dunder. If you just want to pass a text string and get back a module, importlib is a better choice.

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2021-09-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 22.09.2021 21:02, Raymond Hettinger wrote: >> The language specification says that the dicts maintain insertion >> order, but the wording implies that this only to explicit >> dictionaries, not instance attribute or other namespace dicts. > > That is

[issue45266] subtype_clear can not be called from derived types

2021-09-22 Thread Victor Milovanov
Victor Milovanov added the comment: To put it differently, if you think in terms of MRO, my custom type's MRO is my_type_clear (from my type), subtype_clear (from PyTypeObject), etc And subtype_clear incorrectly assumes that it is the first entry in the object's MRO list for tp_clear.

[issue45266] subtype_clear can not be called from derived types

2021-09-22 Thread Victor Milovanov
New submission from Victor Milovanov : I am trying to define a type in C, that derives from PyTypeObject. I want to override tp_clear. To do so properly, I should call base type's tp_clear and have it perform its cleanup steps. PyTypeObject has a tp_clear implementation: subtype_clear.

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2021-09-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Overall, I expect the improved sharing to more than > compensate for the disadvantages. I expect the opposite. This makes all dicts pay a price (in space, initialization time, and complexity) for a micro-optimization of an uncommon case (the normal

[issue45020] Freeze all modules imported during startup.

2021-09-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 22.09.2021 20:47, Brett Cannon wrote: > What about if there isn't a pre-computed location for __file__? I could > imagine a self-contained CPython build where there is no concept of a file > location on disk for anything using this. This does work

[issue45020] Freeze all modules imported during startup.

2021-09-22 Thread Brett Cannon
Brett Cannon added the comment: What about if there isn't a pre-computed location for __file__? I could imagine a self-contained CPython build where there is no concept of a file location on disk for anything using this. -- ___ Python tracker

Re: XML Considered Harmful

2021-09-22 Thread Dennis Lee Bieber
On Tue, 21 Sep 2021 13:12:10 -0500, "Michael F. Stemper" declaimed the following: >On the prolog thread, somebody posted a link to: > > >One thing that it tangentially says is "XML is not the answer." > >I read this page right when I was

Re: XML Considered Harmful

2021-09-22 Thread Michael F. Stemper
On 21/09/2021 19.30, Eli the Bearded wrote: In comp.lang.python, Michael F. Stemper wrote: I've heard of JSON, but never done anything with it. You probably have used it inadvertantly on a regular basis over the past few years. Websites live on it. I used to use javascript when I was

Re: XML Considered Harmful

2021-09-22 Thread Michael F. Stemper
On 21/09/2021 16.21, Pete Forman wrote: "Michael F. Stemper" writes: On 21/09/2021 13.49, alister wrote: On Tue, 21 Sep 2021 13:12:10 -0500, Michael F. Stemper wrote: It's my own research, so I can give myself the data in any format that I like. as far as I can see the main issue with XML

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread Tim Holy
Tim Holy added the comment: > And I hope that Tim Holy is interested too :-) Sure, I'll bite :-). On the topic of which statistic to show, I am a real fan of the histogram. As has been pointed out, timing in the real world can be pretty complicated, and I don't think it does anyone good to

Re: XML Considered Harmful

2021-09-22 Thread Pete Forman
Jon Ribbens writes: > On 2021-09-21, Pete Forman wrote: >> CSV is quite good as a lowest common denominator exchange format. I >> say quite because I would characterize it by 8 attributes and you >> need to pick a dialect such as MS Excel which sets out what those >> are. XML and JSON are

Re: Free OCR package in Python and selecting appropriate widget for the GUI

2021-09-22 Thread DFS
On 9/22/2021 1:54 AM, Mohsen Owzar wrote: DFS schrieb am Mittwoch, 22. September 2021 um 05:10:30 UTC+2: On 9/21/2021 10:38 PM, Mohsen Owzar wrote: DFS schrieb am Dienstag, 21. September 2021 um 15:45:38 UTC+2: On 9/21/2021 4:36 AM, Mohsen Owzar wrote: Hi Guys Long time ago I've written a

Re: Free OCR package in Python and selecting appropriate widget for the GUI

2021-09-22 Thread Mohsen Owzar
DFS schrieb am Mittwoch, 22. September 2021 um 05:10:30 UTC+2: > On 9/21/2021 10:38 PM, Mohsen Owzar wrote: > > DFS schrieb am Dienstag, 21. September 2021 um 15:45:38 UTC+2: > >> On 9/21/2021 4:36 AM, Mohsen Owzar wrote: > >>> Hi Guys > >>> Long time ago I've written a program in Malab a GUI

[issue40027] re.sub inconsistency beginning with 3.7

2021-09-22 Thread Brian
Brian added the comment: txt = ' test' txt = re.sub(r'^\s*', '^', txt) substitutes once because the * is greedy. txt = ' test' txt = re.sub(r'^\s*?', '^', txt) substitutes twice, consistent with the \Z behavior. -- ___ Python tracker

Re: Polymorphic imports

2021-09-22 Thread Dennis Lee Bieber
On Tue, 21 Sep 2021 18:58:31 +, Travis Griggs declaimed the following: >from lib import paths >import paths.dynamic_client_module() > >But this seems to not work. Import can only take real modules? Not programatic >ones? Consider "import" to be equivalent to a compile-time

Re: Free OCR package in Python and selecting appropriate widget for the GUI

2021-09-22 Thread DFS
On 9/21/2021 10:38 PM, Mohsen Owzar wrote: DFS schrieb am Dienstag, 21. September 2021 um 15:45:38 UTC+2: On 9/21/2021 4:36 AM, Mohsen Owzar wrote: Hi Guys Long time ago I've written a program in Malab a GUI for solving Sudoku puzzles, which worked not so bad. Now I try to write this GUI with

[Hint]: python simulator http

2021-09-22 Thread David Caul
Hi All, Making any simulator http request , response base simulator with some UI on browser , what are all things python package can support br David -- https://mail.python.org/mailman/listinfo/python-list

[issue45265] Bug in append() method in order to appending a temporary list to a empty list using for loop

2021-09-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is expected behavior. To get a better understanding, see: https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x To get help writing correct code, please do not use the bug tracker. Consider posting to

[issue40027] re.sub inconsistency beginning with 3.7

2021-09-22 Thread Brian
Brian added the comment: I just ran into this change in behavior myself. It's worth noting that the new behavior appears to match perl's behavior: # perl -e 'print(("he" =~ s/e*\Z/ah/rg), "\n")' hahah -- nosy: +bsammon ___ Python tracker

[issue45265] Bug in append() method in order to appending a temporary list to a empty list using for loop

2021-09-22 Thread Nima
New submission from Nima : I want to make an list consist on subsequences of another list, for example: -- input: array = [4, 1, 8, 2] output that i expect: [[4], [4,1], [4, 1, 8], [4, 1, 8, 2]]

[issue41203] Replace references to OS X in documentation with macOS

2021-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 36122e18148c5b6c78ebce1d36d514fd7cf250f5 by Serhiy Storchaka in branch 'main': bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515) https://github.com/python/cpython/commit/36122e18148c5b6c78ebce1d36d514fd7cf250f5 --

[issue41203] Replace references to OS X in documentation with macOS

2021-09-22 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26914 pull_request: https://github.com/python/cpython/pull/28523 ___ Python tracker

[issue41203] Replace references to OS X in documentation with macOS

2021-09-22 Thread miss-islington
Change by miss-islington : -- pull_requests: +26915 pull_request: https://github.com/python/cpython/pull/28524 ___ Python tracker ___

[issue45238] Fix debug() in IsolatedAsyncioTestCase

2021-09-22 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks, Serhiy! ✨  ✨ -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue45238] Fix debug() in IsolatedAsyncioTestCase

2021-09-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset e06b0fddf69b933fe82f60d78a0f6248ca36a0a3 by Łukasz Langa in branch '3.9': [3.9] bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449) (GH-28522) https://github.com/python/cpython/commit/e06b0fddf69b933fe82f60d78a0f6248ca36a0a3

[issue45238] Fix debug() in IsolatedAsyncioTestCase

2021-09-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 44396aaba9b92b3a38a4b422a000d1a8eb05185a by Łukasz Langa in branch '3.10': [3.10] bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449) (GH-28521) https://github.com/python/cpython/commit/44396aaba9b92b3a38a4b422a000d1a8eb05185a

[issue45238] Fix debug() in IsolatedAsyncioTestCase

2021-09-22 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +26913 pull_request: https://github.com/python/cpython/pull/28522 ___ Python tracker ___

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On the topic average vs. minimum, it's interesting to see this pop up every now and then. When I originally wrote pybench late in 1997, I used average, since it gave good results on my PC at the time. Later on, before pybench was added to Tools/ in Python

[issue45026] More compact range iterator

2021-09-22 Thread Łukasz Langa
Łukasz Langa added the comment: Since len timings for ranges of 100 items are negligible anyway, I personally still favor GH-28176 which is clearly faster during iteration. -- ___ Python tracker

[issue45238] Fix debug() in IsolatedAsyncioTestCase

2021-09-22 Thread Łukasz Langa
Change by Łukasz Langa : -- pull_requests: +26912 pull_request: https://github.com/python/cpython/pull/28521 ___ Python tracker ___

[issue45256] Remove the usage of the C stack in Python to Python calls

2021-09-22 Thread STINNER Victor
Change by STINNER Victor : -- title: Remove the usage of the cstack in Python to Python calls -> Remove the usage of the C stack in Python to Python calls ___ Python tracker

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread Tim Holy
Tim Holy added the comment: To make sure it's clear, it's not 0.08ns/function call, it's a loop and it comes out to 0.08ns/element. The purpose of quoting that number was to compare to the CPU clock interval, which on my machine is ~0.4ns. Any operation that's less than 1 clock cycle is

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: I suggest to close this issue. timeit works as expected. It has limitations, but that's ok. Previous attempts to enhance timeit were rejected. -- ___ Python tracker

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: > but you give no reason for why you should not use the minimum. See https://pyperf.readthedocs.io/en/latest/analyze.html#minimum-vs-average I'm not really interested to convince you. Use the minimum if you believe that it better fits your needs. But

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-19007: "precise time.time() under Windows 8: use GetSystemTimePreciseAsFileTime". -- ___ Python tracker ___

[issue45213] Frozen modules are looked up using a linear search.

2021-09-22 Thread Eric Snow
Eric Snow added the comment: On Wed, Sep 22, 2021 at 7:12 AM Dong-hee Na wrote: > I thought about the Trie implementation for this case. On Wed, Sep 22, 2021 at 7:22 AM Marc-Andre Lemburg wrote: > Perhaps a frozen dict could be used instead of the linear search. > > This could then also be

[issue45238] Fix debug() in IsolatedAsyncioTestCase

2021-09-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d by Serhiy Storchaka in branch 'main': bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449) https://github.com/python/cpython/commit/ecb6922ff2d56476a6cfb0941ae55aca5e7fae3d -- nosy:

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thank you Victor, I don't know whether I can convince you or you will convince me, but this is very interesting one way or the other. And I hope that Tim Holy is interested too :-) On Wed, Sep 22, 2021 at 01:51:35PM +, STINNER Victor wrote: > > But

[issue45264] venv: Make activate et al. export custom prompt prefix as an envvar

2021-09-22 Thread John Wodder
New submission from John Wodder : I use a custom script (and I'm sure many others have similar scripts as well) for setting my prompt in Bash. It shows the name of the current venv (if any) by querying the `VIRTUAL_ENV` environment variable, but if the venv was created with a custom

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2021-09-22 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +26911 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/28520 ___ Python tracker

[issue45260] Implement superinstruction UNPACK_SEQUENCE_ST

2021-09-22 Thread zcpara
Change by zcpara : -- keywords: +patch pull_requests: +26910 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28519 ___ Python tracker ___

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2021-09-22 Thread Mark Shannon
Mark Shannon added the comment: This can be mitigated, if not entirely fixed, by storing an ordering bit vector in the values. This way all instances of the class SometimesShared in the example above can share the keys. The keys might be ("optional", "attr") For any instances with only

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: Livius: do you care about using nanosleep(), or can I close the issue? -- ___ Python tracker ___

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: > On Windows with a Python 3.11 debug build, I get: > Mean +- std dev: 21.9 ms +- 7.8 ms (228 values) I wrote an optimization to cache the Windows timer handle between time.sleep() calls (don't close it). I don't think that it's needed because they shortest

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: bench.py: measure the shortest possible sleep. Use time.sleep(1e-10): 0.1 nanosecond. It should be rounded to the resolution of the used sleep function, like 1 ns on Linux. On Linux with Fedora 34 Python 3.10 executable, I get: Mean +- std dev: 60.5 us

[issue41266] IDLE call hints and completions confused by ints and floats

2021-09-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: What is your point? Code without explanation is useless. -- ___ Python tracker ___ ___

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: Livius: your first PR modified Sleep() in Modules/_tkinter.c to use nanosleep(). I don't see the point since this function has a solution of 1 ms (10^-3). Using select() on Unix is enough: resolution of 1 us (10^-6). --

[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: New changeset 58f8adfda3c2b42f654a55500e8e3a6433cb95f2 by Victor Stinner in branch 'main': bpo-21302: time.sleep() uses waitable timer on Windows (GH-28483) https://github.com/python/cpython/commit/58f8adfda3c2b42f654a55500e8e3a6433cb95f2 --

[issue45256] Remove the usage of the cstack in Python to Python calls

2021-09-22 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: commit a0bd9e9c11f5f52c7ddd19144c8230da016b53c6 Author: Serhiy Storchaka Date: Sat May 8 22:33:10 2021 +0300 bpo-28307: Convert simple C-style formatting with literal format into f-string. (GH-5012) C-style formatting with literal format

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: > But timing results are not like that, the measurement errors are one-sided, not two: (..) I suggest you to run tons of benchmarks and look at the distribution. The reality is more complex than what you may think. > measurement = true value + random

[issue41137] pdb uses the locale encoding for .pdbrc

2021-09-22 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner nosy_count: 4.0 -> 5.0 pull_requests: +26909 pull_request: https://github.com/python/cpython/pull/28518 ___ Python tracker ___

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Also, I checked the DWARF tree of all existing wheels for 3.10 on PyPI (there aren't many) and none had anything that uses the size of the struct. -- ___ Python tracker

[issue45213] Frozen modules are looked up using a linear search.

2021-09-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Perhaps a frozen dict could be used instead of the linear search. This could then also be made available as sys.frozen_modules for inspection by applications and tools such as debuggers or introspection tools trying to find source code (and potentially

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > I'll just note that a change in struct size does technically break ABI, since > *arrays* of PyThreadState will break. Not that matters now because we are not proceeding but just to clarify why I deemed this acceptable: arrays of PyThreadState is

[issue45213] Frozen modules are looked up using a linear search.

2021-09-22 Thread Dong-hee Na
Dong-hee Na added the comment: I thought about the Trie implementation for this case. But as Eric said, it can be overkilling for this time. -- nosy: +corona10 ___ Python tracker

[issue45256] Remove the usage of the cstack in Python to Python calls

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: What was rejected was https://www.python.org/dev/peps/pep-0651/ which included this idea but had a lot more stuff in it. In particular, it was rejected because it gave semantics to overflow exceptions (two exceptions were proposed), new APIs and it

[issue45256] Remove the usage of the cstack in Python to Python calls

2021-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: AFAIK Mark Shannon proposed this idea, but it was rejected. -- nosy: +gvanrossum, serhiy.storchaka ___ Python tracker ___

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-09-22 Thread tongxiaoge
tongxiaoge added the comment: I installed OpenSSL version 1.1.1l and tested it again. The problem disappeared. It should be the reason why the OpenSSL version I used before is too low. The current issue is closed -- stage: -> resolved status: open -> closed

[issue44958] [sqlite3] only reset statements when needed

2021-09-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > I'm unable to reproduce this regression on my machine (macOS, debug build, no > optimisations) [...] Correction: I _am_ able to reproduce this. -- ___ Python tracker

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Petr Viktorin
Petr Viktorin added the comment: > The ABI is not broken, the only thing that this PR change is the size of the > struct. All the offsets to the members are the same and therefore will be > valid in any compiled code. I'll just note that a change in struct size does technically break ABI,

[issue45256] Remove the usage of the cstack in Python to Python calls

2021-09-22 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44958] [sqlite3] only reset statements when needed

2021-09-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: I'm unable to reproduce this regression on my machine (macOS, debug build, no optimisations). Are you able to reproduce, Ken? -- ___ Python tracker

[issue44958] [sqlite3] only reset statements when needed

2021-09-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Ouch, that's quite a regression! Thanks for the heads up! I'll have a look at it right away. -- ___ Python tracker ___

[issue44958] [sqlite3] only reset statements when needed

2021-09-22 Thread Ken Jin
Ken Jin added the comment: Erlend, I suspect that 050d1035957379d70e8601e6f5636637716a264b may have introduced a perf regression in pyperformance's sqlite_synth benchmark: https://speed.python.org/timeline/?exe=12==sqlite_synth=1=50=off=on=on The benchmark code is here

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thanks Victor for the explanation about pyperf's addition features. They do sound very useful. Perhaps we should consider adding some of them to timeit? However, in my opinion using the average is statistically wrong. Using the mean is good when errors are

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Always happy to help :) -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue45263] round displays 2 instead of 3 digits

2021-09-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Oh, I forgot: Python mailing lists and IRC: https://www.python.org/community/lists/ https://www.python.org/community/irc/ -- ___ Python tracker

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: PyPy emits a warning when the timeit module is used, suggesting to use pyperf. timeit uses the minimum, whereas pyperf uses the average (arithmetic mean). timeit uses a single process, pyperf spawns 21 processes: 1 just for the loop calibration, 20 to

[issue45263] round displays 2 instead of 3 digits

2021-09-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: "the expected behaviour is to return a digit with 3 decimal points" I presume you mean a float with 3 digits after the decimal point. Three decimal points would be a bug :-) I am afraid that you are misinterpreting what you are seeing. Rounding a number

[issue45061] [C API] Detect refcount bugs on True/False in C extensions

2021-09-22 Thread STINNER Victor
STINNER Victor added the comment: New changeset 8620be99da930230b18ec05f4d7446ee403531af by Victor Stinner in branch 'main': bpo-45061: Revert unicode_is_singleton() change (GH-28516) https://github.com/python/cpython/commit/8620be99da930230b18ec05f4d7446ee403531af --

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I discussed this particular instance with the Steering Council and the conclusion was that this field (use_tracing) is considered an implementation detail and therefore its removal it's justified so we won't be restoring it. I'm therefore closing

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I'm removing the release blocker as per above, feel free to close of there is nothing else to discuss or act on here. -- priority: release blocker -> ___ Python tracker

[Python-announce] ANN: distlib 0.3.3 released on PyPI

2021-09-22 Thread Vinay Sajip via Python-announce-list
I've recently released version 0.3.3 of distlib on PyPI [1]. For newcomers, distlib is a library of packaging functionality which is intended to be usable as the basis for third-party packaging tools. The main changes in this release are as follows: * Fixed #152: Removed splituser() function

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Running timeit with number=1 for fast running processes is not likely to be reliable. The problem is that modern computers are *incredibly noisy*, there are typically hundreds of processes running on them at any one time. Trying to get deterministic times

[issue45263] round displays 2 instead of 3 digits

2021-09-22 Thread Kenneth Fossen
New submission from Kenneth Fossen : When round is given 3 as argument for number of decimal points, the expected behaviour is to return a digit with 3 decimal points Example: ig1 = 0.4199730940219749 ig2 = 0.4189730940219749 print(round(ig1, 3)) # 0.42 expected to be 0.420 print(round(ig2,

[issue45061] [C API] Detect refcount bugs on True/False in C extensions

2021-09-22 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +26908 pull_request: https://github.com/python/cpython/pull/28516 ___ Python tracker ___

[issue45262] crash if asyncio is used before and after re-initialization if using python embedded in an application

2021-09-22 Thread Benjamin Schiller
New submission from Benjamin Schiller : We have embedded Python in our application and we deinitialize/initialize the interpreter at some point of time. If a simple script with a thread that sleeps with asyncio.sleep is loaded before and after the re-initialization, then we get the following

[issue45261] Unreliable (?) results from timeit (cache issue?)

2021-09-22 Thread Tim Holy
New submission from Tim Holy : This is a lightly-edited reposting of https://stackoverflow.com/questions/69164027/unreliable-results-from-timeit-cache-issue I am interested in timing certain operations in numpy and skimage, but I'm occasionally seeing surprising transitions (not entirely

[issue41203] Replace references to OS X in documentation with macOS

2021-09-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26907 pull_request: https://github.com/python/cpython/pull/28515 ___ Python tracker ___

ANN: distlib 0.3.3 released on PyPI

2021-09-22 Thread Vinay Sajip via Python-list
I've recently released version 0.3.3 of distlib on PyPI [1]. For newcomers, distlib is a library of packaging functionality which is intended to be usable as the basis for third-party packaging tools. The main changes in this release are as follows: * Fixed #152: Removed splituser() function

[issue24076] sum() several times slower on Python 3 64-bit

2021-09-22 Thread Stefan Behnel
Stefan Behnel added the comment: Sorry for that, Pablo. I knew exactly where the problem was, the second I read your notification. Thank you for resolving it so quickly. -- ___ Python tracker

Re: Free OCR package in Python and selecting appropriate widget for the GUI

2021-09-22 Thread Roland Mueller via Python-list
Hello, ti 21. syysk. 2021 klo 16.53 Mohsen Owzar (mohsen.ow...@gmail.com) kirjoitti: > Hi Guys > Long time ago I've written a program in Malab a GUI for solving Sudoku > puzzles, which worked not so bad. > Now I try to write this GUI with Python with PyQt5 or TKinter. > First question is: > Is

[issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't

2021-09-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Such a change would be backwards incompatible and no longer in line with PEP 249. I also don't understand what you regard as confusing about the message "unable to open database file". The message could be extended to include the path, but apart from

  1   2   >