[issue42682] awaiting a wrapped asyncio.Task multiple times gives long, repeative tracebacks

2020-12-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

The traceback contains frames from asyncio internal machinery, that's why the 
traceback is long.

IFIAK Python standard library never filters such calls, asyncio is not an 
exception.

On the other hand, well-known pytest library supports `__tracebackhide__ = 
True` for skipping pytest internals in test failure reports.
I'm not sure if we want to do such black magic though.

Plus, sometimes an information about internals is helpful to detect the actual 
source of the problem,

I have no clear vision of how to skip internal frames easily. 

Yuri, maybe you have an idea?

--

___
Python tracker 

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



[issue42703] Asyncio Event Documentation Links Incorrect

2020-12-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset d90ff376813843310a6f9ccc96551fa1521e8fef by Matt Fowler in branch 
'master':
BPO-42703: Fix incorrect documentation links for asyncio.Event (GH-23881)
https://github.com/python/cpython/commit/d90ff376813843310a6f9ccc96551fa1521e8fef


--
nosy: +asvetlov

___
Python tracker 

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



[issue42703] Asyncio Event Documentation Links Incorrect

2020-12-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +22761
pull_request: https://github.com/python/cpython/pull/23908

___
Python tracker 

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



[issue42703] Asyncio Event Documentation Links Incorrect

2020-12-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22762
pull_request: https://github.com/python/cpython/pull/23909

___
Python tracker 

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



[issue42703] Asyncio Event Documentation Links Incorrect

2020-12-23 Thread miss-islington


miss-islington  added the comment:


New changeset 1e1bacf9e61143e7b0f78de9dcb578983bea8f81 by Miss Islington (bot) 
in branch '3.9':
BPO-42703: Fix incorrect documentation links for asyncio.Event (GH-23881)
https://github.com/python/cpython/commit/1e1bacf9e61143e7b0f78de9dcb578983bea8f81


--

___
Python tracker 

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



[issue42703] Asyncio Event Documentation Links Incorrect

2020-12-23 Thread miss-islington


miss-islington  added the comment:


New changeset 412c935a37eb8fe290b684c44c80cf361f6b814b by Miss Islington (bot) 
in branch '3.8':
BPO-42703: Fix incorrect documentation links for asyncio.Event (GH-23881)
https://github.com/python/cpython/commit/412c935a37eb8fe290b684c44c80cf361f6b814b


--

___
Python tracker 

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



[issue42703] Asyncio Event Documentation Links Incorrect

2020-12-23 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue42723] Unclear why dict unpacking cannot be used in dict comprehension

2020-12-23 Thread Luke Davis


New submission from Luke Davis :

Why am I unable to do:

dict = { **sub_dict for sub_dict in super_dict.values() }

which throws: "dict unpacking cannot be used in dict comprehension"

Whereas the equivalent code below doesn't throw any errors?:

dict = {}
for sub_dict in super_dict.values():
dict = { **dict, **sub_dict }

Am I wrong in thinking the first and second block of code should do the same 
thing behind the scenes?

--
messages: 383641
nosy: PartlyFluked
priority: normal
severity: normal
status: open
title: Unclear why dict unpacking cannot be used in dict comprehension
type: enhancement

___
Python tracker 

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



[issue42693] "if 0:" lines are traced; they didn't use to be

2020-12-23 Thread Mark Shannon


Mark Shannon  added the comment:

I'll briefly answer the above questions, but we could we close this issue?

If there are specific issues regarding PEP 626, please make a new issue. Feel 
free to +nosy me on those issues.

I intend to review all the recent changes to the compiler in the new year,
in case there are any obvious inefficiencies.

Ned,
The bytecode for 3.10a should be more efficient than 3.9.
IMO, it is not worth spending too much time on making the bytecode look pretty, 
and that if we care about performance it would be better to spend our time 
elsewhere.

Serhiy,
The bytecode for the test in the while statement is duplicated; one in the loop 
header, one in the body. Try it under pdb, you'll see that it breaks at two 
different places in the bytecode. 
See https://github.com/python/cpython/pull/23743

Benjamin,
Eventually, yes we will want to implement something like the JVMTI for the JVM. 
However, for that to be useful we still need precise line number tracing.

--

___
Python tracker 

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



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

2020-12-23 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 28b75c80dcc1e17ed3ac1c69362bf8dc164b760a by Mark Shannon in 
branch 'master':
bpo-42246: Don't eliminate jumps to jumps, if it will break PEP 626. (GH-23896)
https://github.com/python/cpython/commit/28b75c80dcc1e17ed3ac1c69362bf8dc164b760a


--

___
Python tracker 

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



[issue42723] Unclear why dict unpacking cannot be used in dict comprehension

2020-12-23 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

They don't do the same thing.

The dict comprehension requires a single key:value pair per loop. It 
accumulates values into a single dict. Try this:

d = {}
for key, value in items:
print(id(d))
d[key] = value

The ID doesn't change because it is the same dict each time.

Unpacking a dict doesn't produce a single key:value pair, except maybe by 
accident, so it is not usable in a dict comprehension.

Your second example doesn't modify a single dict, it **replaces** it with a new 
dict each time.

d = {}
for sub_dict in super_dict.values():
print(id(d))
d = { **d, **sub_dict }

The IDs will change through the loop as d gets replaced with a new dict each 
time. So this is not equivalent to a comprehension.

Also, the second would also be very inefficient. It unpacks the existing dict, 
then packs the values into a new dict, then unpacks it again, then repacks it 
into yet another dict, and so on.

Better:

d = {}
for sub_dict in super_dict.values():
d.update(sub_dict)

But that's not equivalent to a dict comprehension either.

--
nosy: +steven.daprano
resolution:  -> not a bug
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



[issue36702] test_dtrace failed

2020-12-23 Thread Brian Costlow


Brian Costlow  added the comment:

There are actually two different issues here.

dtrace -q will not work on Fedora-based linux (haven't tried elsewhere) and 
that probably should be corrected, but that is NOT what causes the test fail. 

The tests' setup checks whether dtrace is usuable, and since it is not, those 
tests are skipped. 

However, stap IS usable, so those tests run.

test.test_dtrace.SystemTapOptimizedTests.test_line will always fail because it 
expects files in dtracedata (line.stp and line.stp.expected) that are not there.

I've attached a file showing isolated runs of test_dtrace on a newly built 
Python 3.8.6 on two Centos 7 systems.

The first is against the official Centos 7 Docker container, and stap fails 
because Linuxkit kernel modules are not installed. The test_dtrace check for a 
working stap fails, and all 4 tests are skipped.

The second is against a virtualized Centos 7 where the kernel modules are 
properly installed and stap works.

I don't see how test_dtrace ever passes on a system with a working /bin/stap 
command.

--
nosy: +brian.costlow
Added file: https://bugs.python.org/file49696/test_dtrace_stap_bug.txt

___
Python tracker 

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



[issue42724] Change library name when building.

2020-12-23 Thread Corentin Bolou


New submission from Corentin Bolou :

Hello python community.
I use python in a software I develop.
I succeed the standard build into lib/dll on windows.
However, I have difficulties when I want to change the name of the lib. And 
used them with the new name in my project.
I follow the Readme that tell to change the name, we have to change in PCbuild 
the python.props. So I did that and I had the right name I wanted after 
building python. But when I compile my project, when I reached the link step,my 
project search for the old library name. And I have nothing in my code that try 
to search for this library. I add the include python.lib in my project 
settings, but it said that it cannot open file python38.lib. I think some 
compile C code may reference to his name. And if it's the case. I want to know 
if it's possible to build python with a different name than  python38 and 
python38_d.lib/dll on Windows. 
Sincerely,
Corentin

--
components: Build
messages: 383646
nosy: corentin.bolou27
priority: normal
severity: normal
status: open
title: Change library name when building.
type: compile error
versions: Python 3.8

___
Python tracker 

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2020-12-23 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

Since the annotations are processed just like all other expressions in the 
symbol table, the generated entries for functions etc. This would result with 

def foo():
for number in range(5):
foo: (yield number)
return number

foo()

returning a generator / coroutine (depending on yield/yield from/await usage). 
Is this something we want to keep or maybe tweak the symbol table generator to 
not to handle annotations (since there are also more subtle issues regarding 
analysis of cell / free vars).

--
messages: 383647
nosy: BTaskaya, gvanrossum
priority: normal
severity: normal
status: open
title: PEP 563: Should the behavior change for yield/yield from's

___
Python tracker 

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



[issue41960] Add globalns and localns to the inspect.signature and inspect.Signature.from_callable

2020-12-23 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> It's been a while, I've lost context for this idea. What problem are you 
> trying to solve here? Are there issues where people have reported problems 
> that this would allow them to solve?

Context: https://github.com/python/cpython/pull/20434#discussion_r499289645

tl;dr: 
import inspect

def foo():
class F: ...
def foo(bar: F): ...
print(inspect.signature(foo))

foo()

Normally, if inspect.signature is able to resolve annotations with the current 
globals()/locals() it will give the resolved version, if not the string 
version. So adding this would allow people to choose which namespace 
inspect.signature will pass to the typing.get_type_hints. 
(inspect.signature(foo, localns=locals()) would give directly the F object 
instead of 'F', etc.)

--

___
Python tracker 

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



[issue28468] Add platform.freedesktop_os_release()

2020-12-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22763
pull_request: https://github.com/python/cpython/pull/23913

___
Python tracker 

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



[issue28468] Add platform.freedesktop_os_release()

2020-12-23 Thread miss-islington


miss-islington  added the comment:


New changeset bfda4f5776fd20f92b441c8a88ee7a9d44dc8777 by Victor Stinner in 
branch 'master':
bpo-28468: Fix typo in _os_release_candidates (GH-23913)
https://github.com/python/cpython/commit/bfda4f5776fd20f92b441c8a88ee7a9d44dc8777


--
nosy: +miss-islington

___
Python tracker 

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



[issue38655] ipaddress.ip_network('0.0.0.0/0').is_private == True

2020-12-23 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 41b223d29cdfeb1f222c12c3abaccc3bc128f5e7 by Raymond Hettinger in 
branch 'master':
bpo-9694: Fix misleading phrase "optional arguments" (GH-23858)
https://github.com/python/cpython/commit/41b223d29cdfeb1f222c12c3abaccc3bc128f5e7


--

___
Python tracker 

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



[issue9694] argparse required arguments displayed under "optional arguments"

2020-12-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue42711] lru_cache and NotImplemented

2020-12-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the suggestion, but I think it is better to use the tool as designed 
without any special cases.

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



[issue32381] Python 3.6 cannot reopen .pyc file with non-ASCII path

2020-12-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a12491681f08a33abcca843f5150330740c9 by Victor Stinner in 
branch 'master':
bpo-32381: pymain_run_command() uses PyCF_IGNORE_COOKIE (GH-23724)
https://github.com/python/cpython/commit/a12491681f08a33abcca843f5150330740c9


--

___
Python tracker 

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



[issue42724] Change library name when building.

2020-12-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

This tracker is for reporting bugs in python. I think you'd have better luck 
asking this question on Stack Overflow, or maybe the python-list mailing list: 
https://mail.python.org/mailman/listinfo/python-list

--
nosy: +eric.smith

___
Python tracker 

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



[issue42726] gdb/libpython.py InstanceProxy does not work with py3

2020-12-23 Thread Augusto Hack


New submission from Augusto Hack :

Calling `proxyval` on an instance of a user defined class fails.

minimally reproducible example:
```
from time import sleep

class A:
def __init__(self):
self.a = 1

a = A()
sleep(10)
```
Attach to process and run:
```
py-up
python-interactive
Frame.get_selected_python_frame().get_pyop().get_var_by_name('a')[0].proxyval(set())
```
Will result in the following error:
```
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/lib/debug/usr/lib64/libpython3.7m.so.1.0-3.7.9-2.fc33.x86_64.debug-gdb.py",
 line 471, in __repr__
for arg, val in self.attrdict.iteritems()])
AttributeError: 'dict' object has no attribute 'iteritems'
```
Tested on fedora 33 with python3.7 and debugsymbols

--
components: Demos and Tools
messages: 383654
nosy: hack.augusto
priority: normal
pull_requests: 22764
severity: normal
status: open
title: gdb/libpython.py InstanceProxy does not work with py3
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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2020-12-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Ouch.  I think we should generate a SyntaxError if yield [from] is used in an 
annotation.

--

___
Python tracker 

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2020-12-23 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue25246] Alternative algorithm for deque_remove()

2020-12-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Created a new PR that gives a substantial speed-up while keeping the API 
unchanged and while closely matching the logic for list.remove().

--

___
Python tracker 

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



[issue25246] Alternative algorithm for deque_remove()

2020-12-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 6b1ac809b9718a369aea67b99077cdd682be2238 by Raymond Hettinger in 
branch 'master':
bpo-25246: Optimize deque.remove() (GH-23898)
https://github.com/python/cpython/commit/6b1ac809b9718a369aea67b99077cdd682be2238


--

___
Python tracker 

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



[issue25246] Alternative algorithm for deque_remove()

2020-12-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution: rejected -> fixed

___
Python tracker 

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



[issue18140] urlparse, urlsplit confused when password includes fragment (#), query (?)

2020-12-23 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

Not a bug. The message #msg375109 explains how to quote and unquote the '#' in 
the password field, and demonstrates how urllib parses it correctly.

I guess, it was set to open as a mistake. Closing it again.

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2020-12-23 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

This is another side effect of processing annotations (at the symbol table 
construction stage) (and I would assume there are a few more cases like this);

def foo():
outer_var = 1

def bar():
inner_var: outer_var = T

return bar

inner = foo()
print(inner.__closure__)

In theory, there shouldn't be any cells / references to the variables from 
outer scope, but since we process the entry for the annotation and record 
`outer_var` as a free var it is listed here.

--

___
Python tracker 

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2020-12-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

The difference is that that just causes a slight inefficiency, while processing 
'yield' makes the function a generator. So I don't feel as strongly about that.

--

___
Python tracker 

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



[issue23328] urllib.request fails for proxy credentials that contain a '/' character

2020-12-23 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
title: urllib2 fails for proxy credentials that contain a '/' character -> 
urllib.request fails for proxy credentials that contain a '/' character
versions: +Python 3.10 -Python 2.7

___
Python tracker 

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2020-12-23 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> So I don't feel as strongly about that.

Just to note, since I believe the solution for all this might be the same (not 
processing annotations at all, since they will be compiled to strings in the 
later stage). If we go down on that route, it will be simpler but we won't be 
able to raise SyntaxError's for "a: (yield)" / "b: (await/yield from x)". 

By the way, this is what happens if you try to use get_type_hints on a function 
where an argument is (yield):

>>> typing.get_type_hints(a)
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/typing.py", line 537, in __init__
code = compile(arg, '', 'eval')
  File "", line 1
SyntaxError: 'yield' outside function

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.10/typing.py", line 1490, in get_type_hints
value = ForwardRef(value)
  File "/usr/local/lib/python3.10/typing.py", line 539, in __init__
raise SyntaxError(f"Forward reference must be an expression -- got {arg!r}")
SyntaxError: Forward reference must be an expression -- got '(yield)'

--

___
Python tracker 

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



[issue42725] PEP 563: Should the behavior change for yield/yield from's

2020-12-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

If we simply ignored yield in the annotation, wouldn't we have the problem that

def f(a: (yield)): pass

silently changes from being a generator (in 3.9) to not being a generator (in 
3.10)? That would be bad. I'd rather make this an error still. (But for 
nonlocals, not processing sounds fine.)

--

___
Python tracker 

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



[issue41960] Add globalns and localns to the inspect.signature and inspect.Signature.from_callable

2020-12-23 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:


New changeset eee1c7745ab4eb4f75153e71aaa2a62018b7625a by Batuhan Taskaya in 
branch 'master':
bpo-41960: Add globalns and localns parameters to inspect.signature and 
Signature.from_callable (GH-22583)
https://github.com/python/cpython/commit/eee1c7745ab4eb4f75153e71aaa2a62018b7625a


--

___
Python tracker 

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



[issue41960] Add globalns and localns to the inspect.signature and inspect.Signature.from_callable

2020-12-23 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +22765
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23914

___
Python tracker 

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



[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: steven.daprano -> rhettinger

___
Python tracker 

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



[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I like the addition but I'm not sure why you removed the price-earnings ratio 
example from the docs. I think that it's useful to have an example that shows 
that harmonic mean is not *just* for speed-related problems.

I'm not going to reject your change just on this documentation issue, but I 
would like to hear why you removed the P/E example instead of just adding 
additional examples.

--

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-23 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +22766
pull_request: https://github.com/python/cpython/pull/23915

___
Python tracker 

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



[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> I would like to hear why you removed the P/E example
> instead of just adding additional examples.

I tried out the existing P/E example in my Python courses and found that it had 
very little explanatory power — in general, non-finance people know less about 
P/E ratios than they know about the harmonic mean :-)  

For people with a finance background who do already understand P/E ratios, the 
example is weak.  The current example only works mathematically if the 
portfolios are exactly the same market value at the time the ratios are 
combined — this never happens.  Also P/E ratios in real portfolios include zero 
and negative values — that won't work with our harmonic mean.  Also, combining 
P/Es for non-homogenous securities is a bit of dark art.  Given a utility 
stock, a healthcare stock, and a tech stock, the aggregate P/E is rarely 
comparable to anything else.

All that said, I would be happy to add the example back if you think it is 
necessary.  It's your module and it's important that you're happy with it :-)

> I think that it's useful to have an example that shows that 
> harmonic mean is not *just* for speed-related problems.

I considered using a resistors in parallel example, but that is somewhat 
specialized and isn't directly applicable because we normally don't want a mean 
at all, we just want the equivalent resistance.

I also thought about adding something like: "The harmonic mean is the smaller 
of the three Pythagorean means and tends to emphasize the impact of small 
outliers while minimizing the impact of large outliers."  But while this is 
true, I've never seen a data scientist switch from an arithmetic mean to a 
harmonic mean to achieve this effect.

--

___
Python tracker 

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



[issue42721] Using of simple dialogs without default root window

2020-12-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The does not affect IDLE, as the two ask... calls pass parent.  (And I may 
someday replace them with query.Query subclasses.)  But I do prefer that 
tkinter act consistently and sensibly for others.  The PR's initial commit 
message adds this justification for the particular behavior: "It will help to 
use these simple dialog windows in programs which do
not need other GUI."  I agree with this goal.

Contrary to the message above, temporary root is set as _default_root and the 
latter is then set back to None.  Consequently, there can be no temporary if 
_default_root cannot be set.  Changing this would be messy enough that I think 
it reasonable to presume and require that people not otherwise needing a GUI 
will not call no_default_root, or learn to call Tk() if using an installation 
with patched tkinter.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Okay, I'm satisfied with that reasoning, thanks Raymond.

Patch looks good to me. Go for it!

Have a good Christmas and stay safe.

--

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-23 Thread miss-islington


miss-islington  added the comment:


New changeset 6dd3da3cf4a0d6cb62d9c2a155434c127183454d by kj in branch 'master':
bpo-42195: Override _CallableGenericAlias's __getitem__ (GH-23915)
https://github.com/python/cpython/commit/6dd3da3cf4a0d6cb62d9c2a155434c127183454d


--
nosy: +miss-islington

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22767
pull_request: https://github.com/python/cpython/pull/23916

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-23 Thread miss-islington


miss-islington  added the comment:


New changeset a1251980d20ee8aab8d887fc0d30a726247327af by Miss Islington (bot) 
in branch '3.9':
bpo-42195: Override _CallableGenericAlias's __getitem__ (GH-23915)
https://github.com/python/cpython/commit/a1251980d20ee8aab8d887fc0d30a726247327af


--

___
Python tracker 

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



[issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC

2020-12-23 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-23 Thread Ethan Furman


New submission from Ethan Furman :

**kwds are necessary to support __init_subclass__, but __prepare__ currently 
does not accept them.

--
assignee: ethan.furman
messages: 383670
nosy: ethan.furman
priority: normal
severity: normal
status: open
title: [Enum] EnumMeta.__prepare__ needs to accept **kwds
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



[issue42727] [Enum] EnumMeta.__prepare__ needs to accept **kwds

2020-12-23 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +22768
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23917

___
Python tracker 

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



[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset cc3467a57b61b0e7ef254b36790a1c44b13f2228 by Raymond Hettinger in 
branch 'master':
bpo-38308: Add optional weighting to statistics.harmonic_mean() (GH-23914)
https://github.com/python/cpython/commit/cc3467a57b61b0e7ef254b36790a1c44b13f2228


--

___
Python tracker 

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



[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thank you and Merry Christmas.

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



[issue42685] Improve placing of simple query windows.

2020-12-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I took a look at the somewhat messy popup placement in IDLE.  The query.Query 
subclasses are centered over their parent.  Some others are over the window but 
up and to the left.  Maybe they have a custom geometry setting that I should 
delete.  Search and replace dialogs are at the upper left of the screen.  Bad 
if window is at the right edge.  Editor SyntaxError boxes, with no placement 
specified, are centered on the screen.  Centered on the text frame would be 
much better (as long as it did not cover the error).  Same would be true of 
most anything else currently centered.

> * If parent is specified and mapped, the query widget is centered at the 
> center of parent.

I am not sure what 'mapped' means.  With patch, SyntaxError continues to  be 
centered on screen even with editor visible and focused.  Will say more on the 
PR.

> Its position and size can be corrected so that it fits in the virtual root 
> window.
I don't understand this.  Will check the code.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2020-12-23 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 73607be68668ab7f4bee53507c8dc7b5a46c9cb4 by kj in branch 'master':
bpo-41559: Implement PEP 612 - Add ParamSpec and Concatenate to typing (#23702)
https://github.com/python/cpython/commit/73607be68668ab7f4bee53507c8dc7b5a46c9cb4


--

___
Python tracker 

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



[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2020-12-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Huge thanks!

I think the next step is to port the essence to typing_extensions, which has to 
work for anything from 3.5 up (or maybe 3.6), *including* 3.10 and above.

https://github.com/python/typing/tree/master/typing_extensions

Honestly maybe we could just make ParamSpec an alias for TypeVar there, and 
make Concatenate an alias for Tuple?  Because "work" just means that the syntax 
needs to be valid, the type checkers are responsible for using it. (We're still 
working on getting this to work for mypy.)

--

___
Python tracker 

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



[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2020-12-23 Thread Ken Jin


Ken Jin  added the comment:

Thanks for the extremely helpful reviews and help in this Guido!

Sure, I'll probably start work on that next week, slightly busy with life right 
now. After that I'll work on docs.

--

___
Python tracker 

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



[issue36876] [subinterpreters] Global C variables are a problem

2020-12-23 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +22769
pull_request: https://github.com/python/cpython/pull/23918

___
Python tracker 

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



[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
nosy_count: 4.0 -> 5.0
pull_requests: +22770
pull_request: https://github.com/python/cpython/pull/23919

___
Python tracker 

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



[issue38308] Add optional weighting to statistics.harmonic_mean()

2020-12-23 Thread Zackery Spytz


Zackery Spytz  added the comment:

The "versionchanged" for *weights* should be 3.10, not 3.8.  I've created PR 
23919 to fix this.

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



[issue42728] Typo in documentation: importlib.metadata

2020-12-23 Thread Tao He


New submission from Tao He :

There's a typo in importlib.metadata.rst:

In section: 

https://docs.python.org/3/library/importlib.metadata.html#distributions

--
messages: 383678
nosy: sighingnow
priority: normal
severity: normal
status: open
title: Typo in documentation: importlib.metadata
type: enhancement

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2020-12-23 Thread Peixing Xin


Change by Peixing Xin :


--
pull_requests: +22771
pull_request: https://github.com/python/cpython/pull/23920

___
Python tracker 

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



[issue42728] Typo in documentation: importlib.metadata

2020-12-23 Thread Tao He


Change by Tao He :


--
keywords: +patch
pull_requests: +22772
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23921

___
Python tracker 

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