[issue40590] test_subprocess stuck on Windows, x64

2020-05-10 Thread Dima Tisnek


New submission from Dima Tisnek :

The windows test got stuck in my PR, and I'm pretty sure my change is not to 
blame.

The test log looks like this:

0:11:10 load avg: 6.42 [421/423] test_importlib passed
0:11:40 load avg: 5.40 running: test_subprocess (58.5 sec), 
test_multiprocessing_spawn (53.0 sec)
0:12:10 load avg: 5.48 running: test_subprocess (1 min 28 sec), 
test_multiprocessing_spawn (1 min 23 sec)
0:12:40 load avg: 5.44 running: test_subprocess (1 min 58 sec), 
test_multiprocessing_spawn (1 min 53 sec)
0:12:57 load avg: 4.58 [422/423] test_multiprocessing_spawn passed (2 min 10 
sec) -- running: test_subprocess (2 min 16 sec)
0:13:27 load avg: 2.89 running: test_subprocess (2 min 46 sec)
0:13:57 load avg: 2.11 running: test_subprocess (3 min 16 sec)
0:14:27 load avg: 1.54 running: test_subprocess (3 min 46 sec)
...
5:53:33 load avg: 0.48 running: test_subprocess (5 hour 42 min)
5:54:03 load avg: 0.51 running: test_subprocess (5 hour 43 min)
5:54:33 load avg: 0.31 running: test_subprocess (5 hour 43 min)
Terminate batch job (Y/N)? 

https://github.com/python/cpython/pull/19402/checks?check_run_id=658308339

--
components: Tests
messages: 368614
nosy: Dima.Tisnek, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: test_subprocess stuck on Windows, x64
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



[issue40589] Missing path-like versionchanged in shutil.rmtree

2020-05-10 Thread Ville Skyttä

Change by Ville Skyttä :


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

___
Python tracker 

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



[issue40589] Missing path-like versionchanged in shutil.rmtree

2020-05-10 Thread Ville Skyttä

New submission from Ville Skyttä :

shutil.rmtree takes a path-like object starting from 3.6 (due to internal use 
of os.lstat which does that too).

--
assignee: docs@python
components: Documentation
messages: 368613
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Missing path-like versionchanged in shutil.rmtree

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-05-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Can you all please decide which issue to use?

--

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-05-10 Thread Vedran Čačić

Vedran Čačić  added the comment:

Of course, I thought that

2. inspect.getdoc() returns the object's own docstring.

means it returns the object's own docstring _if it has one_. If it doesn't, 
then it should still return the docstring of its class, of course!

I have no problem with the fact that help(1) gives the same help as help(int). 
Of course, same as with the above (subclasses), we might want to emphasize the 
fact that the help is for the class and not for the object itself, but just 
returning nothing is in no way an improvement.

Guido, load is probably from Pandas, df is a relatively standard abbreviation 
for "dataframe" (an instance of a class DataFrame, with many various methods), 
and obj?? in Jupyter opens the help for obj in a subwindow, enabling you to 
browse it and close when you're done with it.

--

___
Python tracker 

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



[issue40588] Creating Virtual Environments Does Not Work (Not Creating Folder)

2020-05-10 Thread Shengjun Zhu


New submission from Shengjun Zhu :

I followed the instructions,  run "python3 -m venv tutorial-env" , but the 
command doesn't create any directory.

https://docs.python.org/3.8/tutorial/venv.html

I followed the instructions in the post below to remove the "Application 
Execution Aliases" for python.exe and python3.exe. That got rid of the exe 
files in WindowsApps. However, now when I type where python3 in CMD, I get: 
INFO: Could not find files for the given pattern(s).
https://superuser.com/questions/1437590/typing-python-on-windows-10-version-1903-command-prompt-opens-microsoft-stor

I changed python3 in the command to python, it worked.
python -m venv tutorial-env

I think in version python3.8, instead python3 , we should use python, right?

--
assignee: docs@python
components: Documentation
messages: 368610
nosy: Shengjun Zhu, docs@python
priority: normal
severity: normal
status: open
title: Creating Virtual Environments Does Not Work (Not Creating Folder)
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



[issue40257] Improve the use of __doc__ in pydoc

2020-05-10 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

> can you clarify your example? What's load()? And what does df?? do?

It was vague on purpose, 

`load()` would be for example `load_csv()` from `pandas` that return a 
`pandas.DataFrame`. The point being that users typically won't really know the 
type of what they will get, they may get a DataFrame, but they may get a 
subclass if for example they use `dask` to do distributed computing. 

`?` or `??` is the way to get help in IPython/Jupyter, we try to pull as much 
information as we can and under the hood call `inspect.getdoc()`.

Assuming 

In [4]: class A:
   ...: "doc"

In [5]: class B(A):
   ...: pass

In [6]: b = B()

Python 3.8 gives:

In [9]: b?
Type:B
String form: <__main__.B object at 0x104be7d00>
Docstring:   
Class docstring: doc

Python 3.9 give

In [4]: b?
Type:B
String form: <__main__.B object at 0x10a0b7140>
Docstring:   


We do already pull docs from the superclass of the instance if no doc is found 
on current object, but now we get even less for the user. We could of course 
publish patch and walk the hierarchy ourselves, but it will require many users 
to upgrade (which you of course know they are not good at).

(Here i'm using `?`, `??` try to pull even more informations like the source, 
known subclasses and other stuff)


(Will try to get examples with actual code, but I haven't had time to build 
pandas or other scientific package on 3.9 yet).

--

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-05-10 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

https://bugs.python.org/issue40587 has been opened. Copy paste of the report as 
below : 


In python 3.8:

```
>>> class A(object):
... """standard docstring"""
... pass
...
>>> import inspect
>>> inspect.getdoc(A())
'standard docstring'
```

In 3.9:

```
$ python
Python 3.9.0a6+ (heads/master:5b956ca42d, May 10 2020, 20:31:26)
[Clang 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class A(object):
KeyboardInterrupt
>>> class A(object):
... """standard docstring"""
... pass
...
>>> import inspect
>>> inspect.getdoc(A())
>>>
```

--
nosy: +xtreak

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-05-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Okay, let's reopen.

@Matthias, can you clarify your example? What's load()? And what does df?? do?

--
status: closed -> open

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-05-10 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

This is going to potentially break a lot of interactive usage in the Scientific 
ecosystem. 

A a lot of people are going to do:

df = load('my.csv')
df??

To ask for help and will get nothing. 

Even for subclass, I want to argue that a docstring for a superclass is better 
than no docstring. 


This will be devastating for many users.

--
nosy: +mbussonn

___
Python tracker 

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



[issue40575] _PyDict_GetItemIdWithError() should call _PyDict_GetItem_KnownHash()

2020-05-10 Thread Stefan Behnel


Change by Stefan Behnel :


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



[issue40587] [regression] inspect.getdoc not returning docstring.

2020-05-10 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

That will break a lot o the interactive usage for the scientific ecossytem 
Imho, 

For example anyone that get a Pandas Dataframe and try to get help on it either 
via help(df), or `df?` in IPython/Jupyter.

Might be purposeful (https://bugs.python.org/issue40257)

--

___
Python tracker 

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



[issue40575] _PyDict_GetItemIdWithError() should call _PyDict_GetItem_KnownHash()

2020-05-10 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset 6067d4bc3ce5ff4cfa5b47ceecc84a3941bc031c by scoder in branch 
'master':
bpo-40575: Avoid unnecessary overhead in _PyDict_GetItemIdWithError() (GH-20018)
https://github.com/python/cpython/commit/6067d4bc3ce5ff4cfa5b47ceecc84a3941bc031c


--

___
Python tracker 

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



[issue40587] [regression] inspect.getdoc not returning docstring.

2020-05-10 Thread Matthias Bussonnier


New submission from Matthias Bussonnier :

In python 3.8:

```
>>> class A(object):
... """standard docstring"""
... pass
...
>>> import inspect
>>> inspect.getdoc(A())
'standard docstring'
```

In 3.9:

```
$ python
Python 3.9.0a6+ (heads/master:5b956ca42d, May 10 2020, 20:31:26)
[Clang 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class A(object):
KeyboardInterrupt
>>> class A(object):
... """standard docstring"""
... pass
...
>>> import inspect
>>> inspect.getdoc(A())
>>>
```

--
messages: 368603
nosy: mbussonn
priority: normal
severity: normal
status: open
title: [regression] inspect.getdoc not returning docstring.

___
Python tracker 

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



[issue40587] [regression] inspect.getdoc not returning docstring.

2020-05-10 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
components: +Interpreter Core
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



[issue40585] compile_command exec not raising syntax error with new PGEN Parser

2020-05-10 Thread Guido van Rossum


Change by Guido van Rossum :


--
stage: patch review -> resolved

___
Python tracker 

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



[issue40585] compile_command exec not raising syntax error with new PGEN Parser

2020-05-10 Thread Guido van Rossum


Change by Guido van Rossum :


--
stage: resolved -> patch review

___
Python tracker 

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



[issue40586] Pydoc should support https for hyperlinks.

2020-05-10 Thread Gianni Mariani


Change by Gianni Mariani :


--
type:  -> enhancement

___
Python tracker 

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



[issue40106] multiprocessor spawn

2020-05-10 Thread B. L. Alterman


B. L. Alterman  added the comment:

@Mouse, using "multiprocess" instead of "multiprocessing" will not work if 
you're passing a class that inherits from ABC.

"dill" is one of "multiprocess"'s dependencies and "dill" can't pickle an 
_abc_data object (https://github.com/uqfoundation/dill/issues/332)

--

___
Python tracker 

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



[issue40586] Pydoc should support https for hyperlinks.

2020-05-10 Thread Gianni Mariani


New submission from Gianni Mariani :

pydoc has a regex hard coded for supporting hyperlinks. It supports http and 
ftp. It should support https.

--
components: Demos and Tools
messages: 368601
nosy: owebeeone
priority: normal
severity: normal
status: open
title: Pydoc should support https for hyperlinks.
versions: Python 3.5, 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



[issue40585] compile_command exec not raising syntax error with new PGEN Parser

2020-05-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 5b956ca42de37c761562e9c9aeb96a0e67606e33 by Pablo Galindo in 
branch 'master':
bpo-40585: Normalize errors messages in codeop when comparing them (GH-20030)
https://github.com/python/cpython/commit/5b956ca42de37c761562e9c9aeb96a0e67606e33


--

___
Python tracker 

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



[issue40585] compile_command exec not raising syntax error with new PGEN Parser

2020-05-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue40334] PEP 617: new PEG-based parser

2020-05-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

It definitely has its reasons -- there are pernicious edge cases. Probably 
revealed by the tests.

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-10 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Seem to not be in the new parser but simply in codeop in particular `def 
_maybe_compile`

The logic seem weird (but weird logic usually have a reason), it try to compile 
thrice by appending many `\n`.

1) Why do that and not return the first successful compile directly ? I'm not 
sure. 
2) It does compare the repr of error when  compile(source + "\n") and 
compile(source+'\n\n') and only raise if both are identical (which they are not 
in the new parser, they differ by `\n`...)

SyntaxError('invalid syntax', ('', 1, 6, 'def a-b')) 
vs
SyntaxError('invalid syntax', ('', 1, 6, 'def a-b\n'))


This logic seem to go back to the 2000s.

--

___
Python tracker 

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



[issue40585] compile_command exec not raising syntax error with new PGEN Parser

2020-05-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Let's analyze this here rather than in issue40334 (which is getting top-heavy 
:-).

--
nosy: +gvanrossum

___
Python tracker 

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



[issue40585] compile_command exec not raising syntax error with new PGEN Parser

2020-05-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
nosy: +pablogsal
nosy_count: 1.0 -> 2.0
pull_requests: +19340
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20030

___
Python tracker 

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



[issue38872] Document exec symbol for codeop.compile_command

2020-05-10 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

See the `compile()` documentation for the difference between eval/single/exec:

https://docs.python.org/3/library/functions.html#compile

`exec` is meant for multiline program, for example you would "exec" the string 
read from a file to get a module. 

I don't think we should re-document what each of these does, but list the 
possible values that compile_command/CommandCompiler() can take.

--

___
Python tracker 

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



[issue31203] socket.IP_PKTINFO is missing from python

2020-05-10 Thread Zackery Spytz


Change by Zackery Spytz :


--
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-10 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Thanks Pablo for replying to my tweet, a couple of other non-failing case in 
https://bugs.python.org/issue40585 that I filled concurrently to your message.

(also using this occasion to thanks all of you for your work on the new parser)

--
nosy: +mbussonn

___
Python tracker 

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



[issue31203] socket.IP_PKTINFO is missing from python

2020-05-10 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 4.0 -> 5.0
pull_requests: +19339
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/20029

___
Python tracker 

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



[issue40585] compile_command exec not raising syntax error with new PGEN Parser

2020-05-10 Thread Matthias Bussonnier


New submission from Matthias Bussonnier :

compile_command  used to produce syntax error in exec mode:

```
$ python -c "import codeop; codeop.compile_command('raise = 2', symbol='exec')"
Traceback (most recent call last):
  File "", line 1, in 
  File "...python3.8/codeop.py", line 125, in compile_command
return _maybe_compile(_compile, source, filename, symbol)
  File "...python3.8/codeop.py", line 100, in _maybe_compile
raise err1
  File "...python3.8/codeop.py", line 87, in _maybe_compile
code1 = compiler(source + "\n", filename, symbol)
  File "...python3.8/codeop.py", line 105, in _compile
return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT)
  File "", line 1
raise = 2
  ^
SyntaxError: invalid syntax
```

This happens to not be the case anymore in master, where it simply return 
`None` for above invalid input. 

```
$ python -c "import codeop; codeop.CommandCompiler()('raise = 2', 
symbol='exec')"
```

or many other:

```
 $ python
Python 3.9.0a6+ (heads/master:2cc9b8486d, May 10 2020, 15:52:00)
[Clang 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import codeop;
>>> codeop.compile_command('def a-b', symbol='exec')
>>> codeop.compile_command('await?', symbol='exec')
>>> codeop.compile_command('=!=', symbol='exec')
>>> codeop.compile_command('a await raise b', symbol='exec')
>>> codeop.compile_command('a await raise b?+1', symbol='exec')
```


It is problematic as this is used in many places to decide whether code is 
valid, and for example in IPython to know wether we should insert a new line, 
or try to execute the code. 

It seem to be due to the new PGEN parser as setting PYTHONOLDPARSER solve the 
issue:

```
$ PYTHONOLDPARSER=1 python -c "import codeop; codeop.CommandCompiler()('raise = 
2', symbol='exec')"
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/bussonniermatthias/dev/cpython/Lib/codeop.py", line 171, in 
__call__
return _maybe_compile(self.compiler, source, filename, symbol)
  File "/Users/bussonniermatthias/dev/cpython/Lib/codeop.py", line 100, in 
_maybe_compile
raise err1
  File "/Users/bussonniermatthias/dev/cpython/Lib/codeop.py", line 87, in 
_maybe_compile
code1 = compiler(source + "\n", filename, symbol)
  File "/Users/bussonniermatthias/dev/cpython/Lib/codeop.py", line 136, in 
__call__
codeob = compile(source, filename, symbol, self.flags, True)
  File "", line 1
raise = 2
  ^
SyntaxError: invalid syntax
```

`single` and `eval` appear to behave fine.

--
components: Interpreter Core
messages: 368594
nosy: mbussonn
priority: normal
severity: normal
status: open
title: compile_command exec not raising syntax error with new PGEN Parser
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



[issue40334] PEP 617: new PEG-based parser

2020-05-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

There is some discrepancy with the codeop module when running with the new 
parser:

./python -c "import codeop; codeop.CommandCompiler()('raise = 2\n\n', 
symbol='exec')"

(No error)

./python -Xoldparser -c "import codeop; codeop.CommandCompiler()('raise = 
2\n\n', symbol='exec')"
...
  File "", line 1
raise = 2
  ^
SyntaxError: invalid syntax

--

___
Python tracker 

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



[issue38872] Document exec symbol for codeop.compile_command

2020-05-10 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
nosy: +mbussonn

___
Python tracker 

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



[issue33725] Python crashes on macOS after fork with no exec

2020-05-10 Thread B. L. Alterman


Change by B. L. Alterman :


--
nosy: +blalterman

___
Python tracker 

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



[issue40106] multiprocessor spawn

2020-05-10 Thread B. L. Alterman


Change by B. L. Alterman :


--
nosy: +blalterman

___
Python tracker 

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



[issue40561] Add docstrings for webbrowser open functions

2020-05-10 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: Provide docstrings for public-facing webbrowser functions -> Add 
docstrings for webbrowser open functions

___
Python tracker 

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



[issue40302] Add pycore_byteswap.h internal header file with _Py_bswap32() function

2020-05-10 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


--
nosy: +sir-sigurd
nosy_count: 3.0 -> 4.0
pull_requests: +19338
pull_request: https://github.com/python/cpython/pull/15659

___
Python tracker 

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



[issue40574] segfault causing regression from PEP 573 implementation (PyQt5)

2020-05-10 Thread Thomas Caswell


Thomas Caswell  added the comment:

I think I have figured out the problem.  I had a locally built and cached wheel 
of PyQt5-sip from before PEP573 went in.  If that wheel is used for later 
commits I get the segfault, if I rebuilt the wheel from source it works.

I am not sure if this is an expected sharp edge (wheels are be expected to be 
good between commits prior to a release) or not.


-


Below is a script that will build everything (sip, pyqt5, pyqt5-sip) from 
source and install them into a virtual env.


#! /usr/bin/bash
set -e
set -o xtrace



rm -r ~/.pybuild/py39 || true
pushd cpython
git clean -xfd
./configure --prefix=/home/tcaswell/.pybuild/py39
make -j 9
make install
popd

~/.pybuild/py39/bin/python3 -m venv --copies --clear ~/.virtualenvs/py39



source ~/.virtualenvs/py39/bin/activate
pip install --upgrade pip
echo $PATH

pushd PyQt5
pip install sip --no-binary sip
rm -rf PyQt5-5.14.2
tar -xzf PyQt5-5.14.2.tar.gz

pushd PyQt5-5.14.2
python configure.py --confirm-license
# patch the one palce that does not respect the venv settings
sed -i 's|$(INSTALL_ROOT)/usr|$(INSTALL_ROOT)/$(HOME)/.virtualenvs/py39/usr|g' 
Makefile
make -j 9
make install
popd
popd
pip install PyQt5-sip --no-binary PyQt5-sip

python -c "import PyQt5.QtCore; PyQt5.QtCore.Qt.Key_Control"




--

___
Python tracker 

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



[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2020-05-10 Thread Furkan Onder


Furkan Onder  added the comment:

PR has been sent.

--

___
Python tracker 

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



[issue23677] Mention dict and set comps in library reference

2020-05-10 Thread Furkan Onder


Furkan Onder  added the comment:

PR has been sent.

--

___
Python tracker 

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



[issue23677] Mention dict and set comps in library reference

2020-05-10 Thread Furkan Onder


Change by Furkan Onder :


--
nosy: +furkanonder
nosy_count: 8.0 -> 9.0
pull_requests: +19337
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20027

___
Python tracker 

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



[issue40584] PyType_FromModuleAndSpec function should add the process of tp_vectorcall_offset

2020-05-10 Thread hai shi


Change by hai shi :


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

___
Python tracker 

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



[issue40584] PyType_FromModuleAndSpec function should add the process of tp_vectorcall_offset

2020-05-10 Thread hai shi


New submission from hai shi :

some typeobject using `tp_vectorcall_offset`, if we use 
`PyType_FromModuleAndSpec` to create the the typeobject, it will be faild due 
to `PyType_FromModuleAndSpec` lack the process of `tp_vectorcall_offset`.

so we should adding some process  like 
https://github.com/python/cpython/blob/master/Objects/typeobject.c#L2966-L2976.

--
components: Interpreter Core
messages: 368589
nosy: petr.viktorin, shihai1991, vstinner
priority: normal
severity: normal
status: open
title: PyType_FromModuleAndSpec function should add the process of 
tp_vectorcall_offset
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



[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2020-05-10 Thread Furkan Onder


Change by Furkan Onder :


--
nosy: +furkanonder
nosy_count: 6.0 -> 7.0
pull_requests: +19335
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20025

___
Python tracker 

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



[issue40574] segfault causing regression from PEP 573 implementation (PyQt5)

2020-05-10 Thread Thomas Caswell

Thomas Caswell  added the comment:

The script I used for the bisect was:

---

TARGET_ENV=bisect_env


rm -r ~/.pybuild/$TARGET_ENV || true
git clean -xfd
./configure --prefix=/home/tcaswell/.pybuild/$TARGET_ENV
make -j 9
make install
~/.pybuild/$TARGET_ENV/bin/python3 -m venv --copies --clear 
~/.virtualenvs/$TARGET_ENV

popd

source ~/.virtualenvs/$TARGET_ENV/bin/activate
pip install --upgrade pip
echo $PATH

pushd ../sip# this was at "tip" in the hg repo
pip install .
pip install pyqt5
popd

python -c "import PyQt5.QtCore; PyQt5.QtCore.Qt.Key_Control"
retVal=$?
if [ $retVal -ne 0 ]; then
exit 1
fi

---


I'm on a relatively up-to-date Arch 

➤  gcc --version
gcc (Arch Linux 9.3.0-1) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


---

updating pip is a key step (that I thoughtlessly carried over from my normal 
build process) because that lets it see manylinux2014 wheels and does not try 
to build pyqt5 from source.

python3.9 -m pip freeze
packaging==20.3
pyparsing==2.4.7
PyQt5==5.14.2
PyQt5-sip==12.7.2
sip==5.2.0
six==1.14.0
toml==0.10.0

➤  python3.9 -VV
Python 3.9.0a6+ (heads/master-7-g1c2fa78156:1c2fa78156, May 10 2020, 11:11:03) 
[GCC 9.3.0]




I'm also having issues getting pyqt5 to compile from the tarball, what do you 
mean by "Ah, if I install Python, I can install PyQt5. I installed PyQt5:"?

--

___
Python tracker 

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



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-10 Thread Stefan Behnel


Change by Stefan Behnel :


--
pull_requests: +19334
pull_request: https://github.com/python/cpython/pull/20024

___
Python tracker 

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



[issue40582] Inconsistent exceptions caused by typing + tuple subclasses

2020-05-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

I recommend taking this to a user forum or list. I see no but in typing.py here.

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



[issue40582] Inconsistent exceptions caused by typing + tuple subclasses

2020-05-10 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue40397] Refactor typing._GenericAlias

2020-05-10 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Thanks Serhyi! I can confirm that the issue I posted is fixed.

--
priority: release blocker -> normal

___
Python tracker 

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



[issue40574] segfault causing regression from PEP 573 implementation (PyQt5)

2020-05-10 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue40582] Inconsistent exceptions caused by typing + tuple subclasses

2020-05-10 Thread Ruairidh MacLeod


Ruairidh MacLeod  added the comment:

The original code for this was:

```
from typing import List
from unittest.mock import call

def f(n: List[call]): ...
```

Which produces "SyntaxError: Forward reference must be an expression -- got ''".

I think my only query is whether this behavior is ok, or whether it should 
produce the clearer "TypeError: Parameters to generic types must be types" 
message instead?

--

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-05-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2fbc57af851814df567fb51054cb6f6a399f814a by Serhiy Storchaka in 
branch 'master':
bpo-40257: Tweak docstrings for special generic aliases. (GH-20022)
https://github.com/python/cpython/commit/2fbc57af851814df567fb51054cb6f6a399f814a


--

___
Python tracker 

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



[issue40583] Runtime type annotation mutation leads to inconsistent behavior

2020-05-10 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-05-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +19333
pull_request: https://github.com/python/cpython/pull/20022

___
Python tracker 

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



[issue40397] Refactor typing._GenericAlias

2020-05-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 0122d48681b1df27015cf396559fb283ba364d6d by Serhiy Storchaka in 
branch 'master':
bpo-40397: Fix subscription of nested generic alias without parameters. 
(GH-20021)
https://github.com/python/cpython/commit/0122d48681b1df27015cf396559fb283ba364d6d


--

___
Python tracker 

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



[issue1944] Document PyUnicode_* API

2020-05-10 Thread STINNER Victor


STINNER Victor  added the comment:

"""
Following functions likely should be wrapped with "#ifndef Py_LIMITED_API":

_PyUnicode_ClearStaticStrings
_PyUnicode_EQ
_PyUnicode_FromId
"""

It's already the case since at least Python 3.7. Extract of Python 3.7 
Include/unicodeobject.h:

#ifndef Py_LIMITED_API
/* Return an interned Unicode object for an Identifier; may fail if there is no 
memory.*/
PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*);
/* Clear all static strings. */
PyAPI_FUNC(void) _PyUnicode_ClearStaticStrings(void);

/* Fast equality check when the inputs are known to be exact unicode types
   and where the hash values are equal (i.e. a very probable match) */
PyAPI_FUNC(int) _PyUnicode_EQ(PyObject *, PyObject *);
#endif /* !Py_LIMITED_API */

--
nosy: +vstinner

___
Python tracker 

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



[issue40556] test__xxsubinterpreters leaked [1486, 1484, 1484, 1484] references

2020-05-10 Thread STINNER Victor


STINNER Victor  added the comment:

FYI I also reported the issue to https://bugs.python.org/issue32604#msg368395 
which introduched the regression. But you can keep this issue open until it's 
fixed.

--

___
Python tracker 

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



[issue40549] Convert posixmodule.c to multiphase initialization (PEP 489)

2020-05-10 Thread STINNER Victor


Change by STINNER Victor :


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



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-10 Thread STINNER Victor


STINNER Victor  added the comment:

The posix/nt and _abc modules now use the PEP 573 APIs:

* posix/nt: commit 1c2fa781560608aa4be50c748d4b3f403cfa5035 (bpo-40549)
* _abc: commit 77c614624b6bf2145bef69830d0f499d8b55ec0c (bpo-40566)

--

___
Python tracker 

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



[issue40574] segfault causing regression from PEP 573 implementation (PyQt5)

2020-05-10 Thread STINNER Victor


STINNER Victor  added the comment:

I also with:

   ./configure --prefix=/opt/py39 --with-system-expat --with-system-ffi

I still cannot reproduce the crash. I tested Python at commit 
1c2fa781560608aa4be50c748d4b3f403cfa5035. I tested on Fedora 32 (GCC 10.0.1).

$ /opt/py39/bin/python3.9 -m pip freeze
pyflakes==2.2.0
pyperf==2.0.0
PyQt5==5.14.2
PyQt5-sip==12.7.2

$ /opt/py39/bin/python3.9 -VV
Python 3.9.0a6+ (heads/master:1c2fa78156, May 10 2020, 11:37:38) 
[GCC 10.0.1 20200430 (Red Hat 10.0.1-0.14)]

--

___
Python tracker 

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



[issue40397] Refactor typing._GenericAlias

2020-05-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Even simpler: Dict[T, List[int]][str].

Dict[T, list[int]][str] also fails. But dict[T, list[int]][str] works as 
expected (and there are tests).

--

___
Python tracker 

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



[issue40397] Refactor typing._GenericAlias

2020-05-10 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +19332
pull_request: https://github.com/python/cpython/pull/20021

___
Python tracker 

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



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-10 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-40574: segfault causing regression from PEP 573 implementation 
(PyQt5).

--

___
Python tracker 

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



[issue40574] segfault causing regression from PEP 573 implementation (PyQt5)

2020-05-10 Thread STINNER Victor


Change by STINNER Victor :


--
title: segfault causing regression from PEP 573 implementation -> segfault 
causing regression from PEP 573 implementation (PyQt5)

___
Python tracker 

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



[issue40574] segfault causing regression from PEP 573 implementation

2020-05-10 Thread STINNER Victor


STINNER Victor  added the comment:

Ah, if I install Python, I can install PyQt5. I installed PyQt5:
   python -X faulthandler -c "import PyQt5.QtCore; PyQt5.QtCore.Qt.Key_Control""
doesn't crash.

I also tested the following hello world, it doesn't crash neither.
---
# https://pythonprogramminglanguage.com/pyqt5-hello-world/
import sys
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QLabel, QGridLayout, QWidget
from PyQt5.QtCore import QSize

class HelloWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)

self.setMinimumSize(QSize(640, 480))
self.setWindowTitle("Hello world - pythonprogramminglanguage.com") 

centralWidget = QWidget(self)  
self.setCentralWidget(centralWidget)   

gridLayout = QGridLayout(self) 
centralWidget.setLayout(gridLayout)  

title = QLabel("Hello World from PyQt", self) 
title.setAlignment(QtCore.Qt.AlignCenter) 
gridLayout.addWidget(title, 0, 0)

if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
mainWin = HelloWindow()
mainWin.show()
sys.exit( app.exec_() )
---

I built Python with:

./configure --cache-file=../python-config.cache --with-pydebug CFLAGS=-O0 
--prefix=/opt/py39 --with-system-expat --with-system-ffi
make
make install

What is your OS? How did you build Python? Which SIP and PyQt5 versions did you 
try?

--

___
Python tracker 

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



[issue37986] Improve perfomance of PyLong_FromDouble()

2020-05-10 Thread Mark Dickinson


Change by Mark Dickinson :


--
resolution:  -> fixed
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



[issue40574] segfault causing regression from PEP 573 implementation

2020-05-10 Thread STINNER Victor


STINNER Victor  added the comment:

I tried to install pyqt5 on Python compiled from source:

make
./python -m venv env
env/bin/python -m pip install sip
env/bin/python -m pip install pyqt5


But I failed to install pyqt5:

vstinner@apu$ env/bin/python -m pip install pyqt5
Collecting pyqt5
/home/vstinner/python/master/env/lib/python3.9/site-packages/pip/_vendor/msgpack/fallback.py:133:
 DeprecationWarning: encoding is deprecated, Use raw=False instead.
  unpacker = Unpacker(None, max_buffer_size=len(packed), **kwargs)
  Using cached 
https://files.pythonhosted.org/packages/4d/81/b9a66a28fb9a7bbeb60e266f06ebc4703e7e42b99e3609bf1b58ddd232b9/PyQt5-5.14.2.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
 command: /home/vstinner/python/master/env/bin/python 
/home/vstinner/python/master/env/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py
 prepare_metadata_for_build_wheel /tmp/tmpzl766kxn
 cwd: /tmp/pip-install-a2jym86c/pyqt5
Complete output (33 lines):
Traceback (most recent call last):
  File 
"/home/vstinner/python/master/env/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py",
 line 64, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'sipbuild.api' has no attribute 
'prepare_metadata_for_build_wheel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/vstinner/python/master/env/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py",
 line 207, in 
main()
  File 
"/home/vstinner/python/master/env/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py",
 line 197, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
  File 
"/home/vstinner/python/master/env/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py",
 line 66, in prepare_metadata_for_build_wheel
return _get_wheel_metadata_from_wheel(backend, metadata_directory,
  File 
"/home/vstinner/python/master/env/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py",
 line 95, in _get_wheel_metadata_from_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
  File 
"/tmp/pip-build-env-w2h9381n/overlay/lib/python3.9/site-packages/sipbuild/api.py",
 line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
  File 
"/tmp/pip-build-env-w2h9381n/overlay/lib/python3.9/site-packages/sipbuild/abstract_project.py",
 line 82, in bootstrap
project.setup(pyproject, tool, tool_description)
  File 
"/tmp/pip-build-env-w2h9381n/overlay/lib/python3.9/site-packages/sipbuild/project.py",
 line 410, in setup
self.apply_user_defaults(tool)
  File "project.py", line 62, in apply_user_defaults
super().apply_user_defaults(tool)
  File 
"/tmp/pip-build-env-w2h9381n/overlay/lib/python3.9/site-packages/pyqtbuild/project.py",
 line 86, in apply_user_defaults
super().apply_user_defaults(tool)
  File 
"/tmp/pip-build-env-w2h9381n/overlay/lib/python3.9/site-packages/sipbuild/project.py",
 line 215, in apply_user_defaults
self.builder.apply_user_defaults(tool)
  File 
"/tmp/pip-build-env-w2h9381n/overlay/lib/python3.9/site-packages/pyqtbuild/builder.py",
 line 67, in apply_user_defaults
raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
/home/vstinner/python/master/Lib/tempfile.py:818: ResourceWarning: 
Implicitly cleaning up 
  _warnings.warn(warn_message, ResourceWarning)

ERROR: Command errored out with exit status 1: 
/home/vstinner/python/master/env/bin/python 
/home/vstinner/python/master/env/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py
 prepare_metadata_for_build_wheel /tmp/tmpzl766kxn Check the logs for full 
command output.

--

___
Python tracker 

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



[issue37986] Improve perfomance of PyLong_FromDouble()

2020-05-10 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 86a93fddf72a2711aca99afa0c5374c8d6b4a321 by Sergey Fedoseev in 
branch 'master':
bpo-37986: Improve perfomance of PyLong_FromDouble() (GH-15611)
https://github.com/python/cpython/commit/86a93fddf72a2711aca99afa0c5374c8d6b4a321


--

___
Python tracker 

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



[issue40569] Add optional weights to random.sample()

2020-05-10 Thread David Heiberg


David Heiberg  added the comment:

Ahh I see, thanks for clearing that up!

On Sun, May 10, 2020, 04:41 Raymond Hettinger 
wrote:

>
> Raymond Hettinger  added the comment:
>
> Negative weights are undefined for choices() as well.  Just like bisect()
> and merge() don't verify their inputs are sorted.  Usually, full scan
> precondition checks are expensive in pure python and aren't worth
> penalizing correct code. As Henk-Jaap points-out, negative weights are just
> a special case of meaningless inputs.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40574] segfault causing regression from PEP 573 implementation

2020-05-10 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +corona10, petr.viktorin, vstinner

___
Python tracker 

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



[issue40549] Convert posixmodule.c to multiphase initialization (PEP 489)

2020-05-10 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1c2fa781560608aa4be50c748d4b3f403cfa5035 by Victor Stinner in 
branch 'master':
bpo-40549: Convert posixmodule.c to multiphase init (GH-19982)
https://github.com/python/cpython/commit/1c2fa781560608aa4be50c748d4b3f403cfa5035


--

___
Python tracker 

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



[issue40397] Refactor typing._GenericAlias

2020-05-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Jelle for your report. There is even simpler example:

Dict[Tuple[T], List[int]][str]

--

___
Python tracker 

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



[issue40397] Refactor typing._GenericAlias

2020-05-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset fcb285609a2e55f2dc63dcfbb32e4e2fddf71546 by Serhiy Storchaka in 
branch 'master':
bpo-40397: Remove __args__ and __parameters__ from _SpecialGenericAlias 
(GH-19984)
https://github.com/python/cpython/commit/fcb285609a2e55f2dc63dcfbb32e4e2fddf71546


--

___
Python tracker 

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



[issue40583] Runtime type annotation mutation leads to inconsistent behavior

2020-05-10 Thread Saumitro Dasgupta


New submission from Saumitro Dasgupta :

Adding type annotations at runtime may lead to inconsistent results. Consider 
the following example:

class Base:
base: int

class Alpha(Base):
pass

class Beta(Base):
foobar: int

# Case 1: This mutates Base's __annotations__
Alpha.__annotations__['injected'] = bool
assert Alpha.__annotations__ is Base.__annotations__

# Case 2: This mutates Beta's own copy of __annotations__
Beta.__annotations__['injected'] = bool

Such mutations of __annotations__ seem to be perfectly legal 
(https://www.python.org/dev/peps/pep-0526/#runtime-effects-of-type-annotations).

However:
1. In case 1, this leads to the accidental mutation of Base's annotations. Not 
entirely certain if that's expected, but seems undesirable.

2. There are further differences when looking at `__dict__['__annotations__']`: 
for Alpha, there is no __annotations__ entry in __dict__. However, for Beta, 
it's set to `{'foobar': , 'injected': }`. This 
discrepancy leads to further inconsistent results. In particular, when 
transforming these classes to dataclasses, which specifically looks at 
__dict__['__annotations__'](https://github.com/python/cpython/blob/3.8/Lib/dataclasses.py#L856).
 Converting Alpha to a dataclass leads to no fields. Converting Beta to a 
dataclass leads to two fields (foobar and injected).  It's worth noting that 
typing.get_type_hints produces reasonable results here.

--
components: Interpreter Core, Library (Lib)
messages: 368569
nosy: Saumitro Dasgupta
priority: normal
severity: normal
status: open
title: Runtime type annotation mutation leads to inconsistent behavior
type: behavior
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