[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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?

--
components: Tests
messages: 385098
nosy: lizhu
priority: normal
severity: normal
status: open
title: How to handle import tripartite pacakge  issue in unittest scripts for 
python expect mock.Mock
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 even better to emit 
warnings or raise exceptions to indicate any errors.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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'.
 ]
SyntaxError: cannot assign to function call

Breaking the expression elsewhere, including before 'str', gives the same 
message and highlighted 's'.

I did not test before recompiling but it is certainly correct now.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 correct message,
  SyntaxError: cannot assign to function call
and correctly points to the 's' of 'str' on the first line.  Ditto when run 
from IDLE's Shell or editor.  Thank you for the fix.

Installed Python 3.10.0a4, Jan 4, gives the correct message  but confusingly 
points at the final ']' on a line by itself.  The latter should be fixed in the 
next release.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 that copy/unlink are only used if the destination 
is on another filesystem.

Anyway, falling back on copy/unlink is sub-optimal as a move operation [1] and 
should be avoided wherever possible. It would be better to use os.replace() 
instead of os.rename(). This expands support for an atomic move within a 
filesystem, and it avoids the need to modify the documentation, except to 
reference os.replace() instead of os.rename().

---

[1] As implemented, a copy will not retain the source file's alternate data 
streams, security descriptor (i.e. owner and access/audit control), file 
attributes, or extended file attributes. There are additional problems with 
reparse points other than symlinks, but that's a difficult problem. We don't 
support raw copying of reparse points, or even high-level support for creating 
mountpoint (aka junction) reparse points. There's _winapi.CreateJunction, but 
the current implementation is just for testing purposes.

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 in Linux 4.7 in 2016 default for some architectures 
in 2020, in 2021 still not default everywhere.

Similarly I think this needs more testing than it will get living here as a 
bug.   If, like Linux the scheduler was pluggable, it could be shipped and 
enabled by real users that were brave enough and data could be collected.

--
nosy: +stuaxo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
nosy: mfxuus
priority: normal
severity: normal
status: open
title: xml.parsers.expat results differ buffer_text and / or buffer_size
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 follow 
os.rename()'s behavior.

According to https://docs.python.org/3/library/os.html#os.rename

"On Windows, if dst exists a FileExistsError is always raised."

However, their behaviors are not the same.

For os.rename, it does raise FileExistsError if dst exists.
For shutil.move, it silently overwrites dst.

It's either a bug in behavior of shutil.move, or the documentation need to be 
updated.

--
components: Library (Lib)
messages: 385083
nosy: fireattack
priority: normal
severity: normal
status: open
title: On Windows, shutil.move doesn't raise FileExistsError if dst exists like 
os.rename
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 they don't access 
__context__ directly.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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?

--
nosy: +methane

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 merge this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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   read_classvar_from_instance
  16.4 ns   read_instancevar
  23.6 ns   read_instancevar_slots
  20.2 ns   read_namedtuple
  40.5 ns   read_boundmethod

PR 24216

Variable and attribute read access:
   4.5 ns   read_local
   5.8 ns   read_nonlocal
   7.8 ns   read_global
   8.2 ns   read_builtin
  21.4 ns   read_classvar_from_class
  19.0 ns   read_classvar_from_instance
  16.6 ns   read_instancevar
  10.2 ns   read_instancevar_slots
  20.5 ns   read_namedtuple
  42.9 ns   read_boundmethod

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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   | 2021-01-14_09-40-master-14cfa325c298 | 
2021-01-14_10-39-slotscache-9123a84ad8d4 |
+=+==+==+
| float   | 148 ms   | 133 ms: 1.11x 
faster |
+-+--+--+
| pidigits| 265 ms   | 252 ms: 1.05x 
faster |
+-+--+--+
| scimark_monte_carlo | 130 ms   | 126 ms: 1.03x 
faster |
+-+--+--+
| spectral_norm   | 168 ms   | 164 ms: 1.03x 
faster |
+-+--+--+
| logging_silent  | 221 ns   | 216 ns: 1.02x 
faster |
+-+--+--+
| sympy_expand| 598 ms   | 585 ms: 1.02x 
faster |
+-+--+--+
| regex_v8| 31.9 ms  | 32.6 ms: 1.02x 
slower|
+-+--+--+
| deltablue   | 8.93 ms  | 9.16 ms: 1.03x 
slower|
+-+--+--+
| unpickle| 17.0 us  | 17.7 us: 1.04x 
slower|
+-+--+--+
| Geometric mean  | (ref)| 1.00x faster 
|
+-+--+--+

Benchmark hidden because not significant (50): sympy_sum, 
sqlalchemy_imperative, sympy_str, sympy_integrate, dulwich_log, scimark_fft, 
genshi_text, tornado_http, regex_dna, sqlalchemy_declarative, mako, 
meteor_contest, unpickle_pure_python, xml_etree_parse, genshi_xml, scimark_sor, 
sqlite_synth, pickle_pure_python, nbody, pickle_dict, pyflate, regex_effbot, 
xml_etree_process, logging_simple, python_startup, 2to3, fannkuch, 
python_startup_no_site, raytrace, go, hexiom, scimark_lu, json_dumps, richards, 
logging_format, xml_etree_generate, chaos, telco, pickle_list, unpack_sequence, 
regex_compile, django_template, json_loads, crypto_pyaes, xml_etree_iterparse, 
unpickle_list, nqueens, chameleon, scimark_sparse_mat_mult, pickle
Ignored benchmarks (1) of 
json_old/2021-01-14_09-40-master-14cfa325c298.json.gz: pathlib


I uploaded the pyperf result data to bpo as well

--
Added file: https://bugs.python.org/file49744/result2.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 .lineno 
https://github.com/python/cpython/blob/971235827754eee6c0d9f7d39b52fecdfd4cb7b4/Lib/pyclbr.py#L212-L214

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, cheryl.sabella, gvanrossum
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 .

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 knowledgeable in 
importlib.import_module?

Regards, John Brearley
613-259-5622 (Home)

From: Guido van Rossum 
Sent: 2021-01-14 11:03 AM
To: brear...@bell.net 
Subject: [issue42928] adafruit_ads1x15.ads1115 not comaptible with 
globals()[pkg_trunc] = importlib.import_module(pkg_trunc)

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

___
Python tracker 

___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 error handling & messaging.

globals()[pkg_trunc] = importlib.import_module(pkg_trunc)

The high level observation is that board, busio & adafruit_extended_bus objects 
continue to be correctly created after the import loop is done. Its just 
adafruit_ads1x15.ads1115 that does not like this import method.

The same line of code creating ads10 gets error:
Traceback (most recent call last):
File "ada_dbg2.py", line 33, in
ads10 = adafruit_ads1x15.ads1115.ADS1115(i2c_1, address=0x48)
AttributeError: module 'adafruit_ads1x15' has no attribute 'ads1115'

When I look at the global variables, from ads_dbg1.py, I see:
'adafruit_ads1x15': ,

When I look at the global variables, from ads_dbg2.py, I see:
'adafruit_ads1x15.ads1115': ,

So I tried doing the import without the .ads1115 appended, & got:
'adafruit_ads1x15': ,

But I still get an error.
Traceback (most recent call last):
File "ada_dbg2.py", line 33, in
ads10 = adafruit_ads1x15.ads1115.ADS1115(i2c_1, address=0x48)
AttributeError: module 'adafruit_ads1x15' has no attribute 'ads1115'

I went through all 8 permutations of with/without the .ads1115 in the 
importlib.import_module statement, no luck.

Comments?

--
components: Interpreter Core
files: ada_dbg1.py
messages: 385069
nosy: jbrearley
priority: normal
severity: normal
status: open
title: adafruit_ads1x15.ads1115 not comaptible with globals()[pkg_trunc] = 
importlib.import_module(pkg_trunc)
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49741/ada_dbg1.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, yielding results in the order that tasks 
complete, like multiprocessing.Pool.imap_unordered, could be added on top of 
this, which would be really neat. (I know there's 
concurrent.futures.as_completed, but again, that one doesn't handle infinite 
iterables.)

--
nosy: +David Lukeš

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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)
https://github.com/python/cpython/commit/14cfa325c298ceb9eaf6b585a3cdcabf6c6378a9


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com