[issue42932] How to handle import tripartite pacakge issue in unittest scripts for python expect mock.Mock

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: Please try a user forum. E.g. stackoverflow. -- nosy: +gvanrossum resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue42932] How to handle import tripartite pacakge issue in unittest scripts for python expect mock.Mock

2021-01-14 Thread lizhu
New submission from lizhu <2541058...@qq.com>: Hi, all When i use unittest to test my package which import other pacakge, however other pacakge use more and more tripartite pacakges, and it has an impact on test case, example: occur an err: moduleNotFindErro how to fix this issue?

[issue42877] TracebackException saves more data than it needs for format

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue42877] TracebackException saves more data than it needs for format

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 4c94d74152a511d977fe26a4f3a32b7352ba9024 by Irit Katriel in branch 'master': bpo-42877: add the 'compact' param to TracebackException's __init__ (#24179) https://github.com/python/cpython/commit/4c94d74152a511d977fe26a4f3a32b7352ba9024

[issue42927] Inline cache for slots

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for all the positive feedback! What is the next step? -- ___ Python tracker ___ ___

[issue42893] Strange XPath search behavior of xml.etree.ElementTree.Element.find

2021-01-14 Thread robpats
robpats added the comment: Thanks for the pointer. I didn't notice this paragraph. xml.etree.ElementTree.Element.find currently returns None if XPath expression is invalid or unsupported. I think it should also return None if position predicates are not preceded by a tag name. It would be

[issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed

2021-01-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: In order to test code.InteractiveCompiler (used by IDLE) and codeop._maybe_compile (which IC calls), which calls compile() 3 times with mode 'single', I entered the example as 2 or 3 lines in Shell. >>> [file for str(file) in [] # Error highlight on 's'. ]

[issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed

2021-01-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: On Windows, Victor's one liner failed on repository debug builds with Windows' process error popup. I have seen this mysterious failure at least once when testing IDLE Shell running on the repository build. After the patch, my debug build gives the

[issue42927] Inline cache for slots

2021-01-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 Thanks for this. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing

[issue42931] Include randbytes in random.__all__

2021-01-14 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing

[issue42931] Include randbytes in random.__all__

2021-01-14 Thread Setrak Balian
Change by Setrak Balian : -- keywords: +patch pull_requests: +23044 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24219 ___ Python tracker ___

[issue42931] Include randbytes in random.__all__

2021-01-14 Thread Setrak Balian
Change by Setrak Balian : -- components: Library (Lib) nosy: sbalian priority: normal severity: normal status: open title: Include randbytes in random.__all__ type: behavior versions: Python 3.10, Python 3.9 ___ Python tracker

[issue42929] On Windows, shutil.move doesn't raise FileExistsError if dst exists like os.rename

2021-01-14 Thread Eryk Sun
Change by Eryk Sun : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.10 ___ Python tracker ___

[issue42929] On Windows, shutil.move doesn't raise FileExistsError if dst exists like os.rename

2021-01-14 Thread Eryk Sun
Eryk Sun added the comment: shutil.move() has always fallen back on copy/unlink if os.rename() fails. This used to be clearly documented to account for the behavior of os.rename() in Windows, but the details were obscured over multiple rewrites. Currently the documentation makes it seem

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-14 Thread Irit Katriel
Irit Katriel added the comment: On the other hand, I think it makes sense to add a print() method to TracebackException so that you can do TracebackException.from_exception(ex, capture_locals=True).print(file) or whatever other combination of current or future params. --

[issue7946] Convoy effect with I/O bound threads and New GIL

2021-01-14 Thread Stuart Axon
Stuart Axon added the comment: Catching up on the comments on this, it seems like nobody has enough certainty to say it will work well enough. In Linux, the scheduler is pluggable, which lets other non-default schedulers be shipped and tried in the real world. - See schedutil, introduced

[issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed

2021-01-14 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: This is now fixed. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue42930] xml.parsers.expat results differ buffer_text and / or buffer_size

2021-01-14 Thread Michael XU
New submission from Michael XU : More details available here: https://stackoverflow.com/questions/65676934/python-xml-parsers-expat-results-differ-based-on-buffer-text-true-or-false-and Raw data to replicate the issue is available upon request. -- components: XML messages: 385086

[issue42827] pegen parser: Multiline eval with assignment to function call: assertion failed

2021-01-14 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset e5fe509054183bed9aef42c92da8407d339e8af8 by Lysandros Nikolaou in branch 'master': bpo-42827: Fix crash on SyntaxError in multiline expressions (GH-24140) https://github.com/python/cpython/commit/e5fe509054183bed9aef42c92da8407d339e8af8

[issue42929] On Windows, shutil.move doesn't raise FileExistsError if dst exists like os.rename

2021-01-14 Thread fireattack
fireattack added the comment: Sorry, I should link https://docs.python.org/3/library/shutil.html#shutil.move for latest doc. But the content is the same. -- ___ Python tracker

[issue42929] On Windows, shutil.move doesn't raise FileExistsError if dst exists like os.rename

2021-01-14 Thread fireattack
New submission from fireattack : According to https://docs.python.org/3.8/library/shutil.html#shutil.move "If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics." I interpret "depending on os.rename() semantics" to mean it will

[issue42927] Inline cache for slots

2021-01-14 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42877] TracebackException saves more data than it needs for format

2021-01-14 Thread Irit Katriel
Irit Katriel added the comment: As discussed on the PR: Since __context__ is documented, we can't just optimize it away. Instead we add a new param "compact", defaulted to False, which controls whether this optimization should be applied. Module level functions in traceback pass True since

[issue42927] Inline cache for slots

2021-01-14 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > This is a great result, IMO. I'm +1 to merge this. Same here. It would be good if Inada-san could confirm the benchmarks. > Can you add a new one `read_slots`? That should be "read_instancevar_slots". Or you refer to some other check? --

[issue42927] Inline cache for slots

2021-01-14 Thread Yury Selivanov
Yury Selivanov added the comment: > Some microbenchmarks: Can you add a new one `read_slots`? -- ___ Python tracker ___ ___

[issue42927] Inline cache for slots

2021-01-14 Thread Yury Selivanov
Yury Selivanov added the comment: > So it seems that everything is in the noise range except the "float" > benchmark that is 1.11x faster Yeah, this is why. https://github.com/python/pyperformance/blob/master/pyperformance/benchmarks/bm_float.py#L12 This is a great result, IMO. I'm +1 to

[issue42927] Inline cache for slots

2021-01-14 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Some microbenchmarks: CURRENT MASTER: Variable and attribute read access: 4.5 ns read_local 5.8 ns read_nonlocal 7.8 ns read_global 7.8 ns read_builtin 21.2 ns read_classvar_from_class 19.1 ns

[issue42927] Inline cache for slots

2021-01-14 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: So it seems that everything is in the noise range except the "float" benchmark that is 1.11x faster -- ___ Python tracker ___

[issue42927] Inline cache for slots

2021-01-14 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: These are the results: venv ❯ python -m pyperf compare_to json_old/* -G --min-speed=2 --table +-+--+--+ | Benchmark |

[issue42920] How to add end_lineno in pyclbr?

2021-01-14 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: It is actually much easier now, considering that we are operating on the AST instead of the token stream. You probably only have to add a new field to Function/Class classes for end_lineno and access .end_lineno attribute here just like how we do for

[issue42920] How to add end_lineno in pyclbr?

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: Hopefully Batuhan (who changed this code ~2 months ago) or Cheryl (who reviewed your previous patch) can help you. You can just close your existing PR and create a new one, still linking to your original issue 38307. -- nosy: +BTaskaya,

[issue42928] adafruit_ads1x15.ads1115 not comaptible with globals()[pkg_trunc] = importlib.import_module(pkg_trunc)

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: They did not imply it was a bug, just that they don't know enough about Python to be able help you. As I said, this tracker is not a help forum (you're taking valuable time away from core developers). Try this forum: https://discuss.python.org/c/users/7 .

[issue42925] Error trace of else inside class

2021-01-14 Thread Mark Shannon
Mark Shannon added the comment: It's a bug. -- assignee: -> Mark.Shannon ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42928] adafruit_ads1x15.ads1115 not comaptible with globals()[pkg_trunc] = importlib.import_module(pkg_trunc)

2021-01-14 Thread John Brearley
John Brearley added the comment: Hi Guido: So the Adafruit CircuitPython forum has already said they aren't really sure this is their issue or not, see: https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15/issues/66 What else would I need to do to get this looked at by people

[issue42928] adafruit_ads1x15.ads1115 not comaptible with globals()[pkg_trunc] = importlib.import_module(pkg_trunc)

2021-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, this is not a help forum. Please try a user forum. Probably you have to find one with people using the Adafruit modules (and CircuitPython?). -- nosy: +gvanrossum resolution: -> third party stage: -> resolved status: open -> closed

[issue42928] adafruit_ads1x15.ads1115 not comaptible with globals()[pkg_trunc] = importlib.import_module(pkg_trunc)

2021-01-14 Thread John Brearley
Change by John Brearley : Added file: https://bugs.python.org/file49743/print_data.py ___ Python tracker ___ ___ Python-bugs-list mailing

[issue42928] adafruit_ads1x15.ads1115 not comaptible with globals()[pkg_trunc] = importlib.import_module(pkg_trunc)

2021-01-14 Thread John Brearley
Change by John Brearley : Added file: https://bugs.python.org/file49742/ada_dbg2.py ___ Python tracker ___ ___ Python-bugs-list mailing

[issue42928] adafruit_ads1x15.ads1115 not comaptible with globals()[pkg_trunc] = importlib.import_module(pkg_trunc)

2021-01-14 Thread John Brearley
New submission from John Brearley : The first attached script ada_dbg1.py.txt which uses simple hardcoded import statements, the creation of ads1115 objects work fine. The second attached script ada_dbg2.py.txt uses a loop to import a variable list of packages, which allows for more graceful

[issue33757] Failed separate test_pdb_next_command_in_generator_for_loop in test_pdb

2021-01-14 Thread Irit Katriel
Irit Katriel added the comment: This will be resolved once we push PR 21989, which resets the breakpoints before the test so the breakpoint number here is always 1. -- nosy: +iritkatriel, taleinat versions: +Python 3.10 -Python 3.6, Python 3.7, Python 3.8

[issue40052] Incorrect pointer alignment in _PyVectorcall_Function() of cpython/abstract.h

2021-01-14 Thread Petr Viktorin
Change by Petr Viktorin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue29842] Make Executor.map work with infinite/large inputs correctly

2021-01-14 Thread David Lukeš
David Lukeš added the comment: Any updates on this? Making Executor.map lazier would indeed be more consistent and very useful, it would be a shame if the PR went to waste :) It's a feature I keep wishing for in comparison with the older and process-only multiprocessing API. And eventually,

[issue42927] Inline cache for slots

2021-01-14 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I will try to run today the pyperformance test suite to see if there is any impact on standard attribute access -- ___ Python tracker

[issue39273] ncurses does not include BUTTON5_* constants

2021-01-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker

[issue39273] ncurses does not include BUTTON5_* constants

2021-01-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 14cfa325c298ceb9eaf6b585a3cdcabf6c6378a9 by Zackery Spytz in branch 'master': bpo-39273: Expose BUTTON5_* constants in the curses module if available (GH-17996)

[issue42927] Inline cache for slots

2021-01-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Slot means so many different things in Python. Here it's about data descriptors created when you set __slots__ in the class definition. It is amazing that so large speed up can be achieved for such base operation. -- nosy: +serhiy.storchaka