[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2020-12-04 Thread Guido van Rossum

Guido van Rossum  added the comment:

Wait, is the OP maybe that there’s a difference between typeshed an the stdlib 
typing.py?

--

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



[issue40939] Remove the old parser

2020-12-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hm, I wonder if there's a typo here in pythonrun.c:

/* For use in Py_LIMITED_API */
#undef Py_CompileString
PyObject *
PyCompileString(const char *str, const char *filename, int start)
{
return Py_CompileStringFlags(str, filename, start, NULL);
}

Shouldn't that function be named Py_CompileString (i.e. Py_ instead of Py)?

This seems to be old code, but there's normally a macro Py_CompileString() that 
translates to Py_CompileStringFlags() in pythonrun.h:

#ifdef Py_LIMITED_API
PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
#else
#define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1)
#define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, 
f, -1)
.
.
.

--

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



[issue42474] improve test coverage for TracebackException's __eq__

2020-11-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue42474] improve test coverage for TracebackException's __eq__

2020-11-29 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset d82e08d185d52086f4d921c08b853c76c80bebbe by Irit Katriel in 
branch '3.8':
[3.8] bpo-42474: test TracebackException comparison to non-equal instances 
(GH-23558)
https://github.com/python/cpython/commit/d82e08d185d52086f4d921c08b853c76c80bebbe


--

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



[issue42474] improve test coverage for TracebackException's __eq__

2020-11-29 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 586bdd1add2ca7236e3096ab7167862cf17f0939 by Irit Katriel in 
branch '3.9':
[3.9] bpo-42474: test TracebackException comparison to non-equal instances 
(GH-23557)
https://github.com/python/cpython/commit/586bdd1add2ca7236e3096ab7167862cf17f0939


--

___
Python tracker 
<https://bugs.python.org/issue42474>
___
___
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-11-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

Now that I've seen and reviewed KJ's implementation using _PosArgs, I am 
worried about it, as it looks quite complicated. @Shantanu, do we really need 
to worry that Callable[P, R] could be ambiguous? If P is a ParamSpec, wouldn't 
Callable[[P], R] be invalid?

--

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



[issue42474] improve test coverage for TracebackException's __eq__

2020-11-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

Irit, can you,do the manual backports?

--

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



[issue42482] TracebackException should not hold reference to the exception traceback

2020-11-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

For background, see 
https://github.com/iritkatriel/cpython/pull/3#issuecomment-734640036 -- it 
seems the link to exc_traceback was added with little concern for the original 
design of TracebackExceptionGroup.

The question is, can we get rid of it, even though it's been undocumented.

--

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



[issue42474] improve test coverage for TracebackException's __eq__

2020-11-27 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 44ca05afc89c9967f5dbc6c3ad89fc298c460e93 by Irit Katriel in 
branch 'master':
bpo-42474: test TracebackException comparison to non-equal instances (GH-23522)
https://github.com/python/cpython/commit/44ca05afc89c9967f5dbc6c3ad89fc298c460e93


--
nosy: +gvanrossum

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



[issue42468] subprocess.CompletedProcess: Add boolean value

2020-11-25 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

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



[issue42468] subprocess.CompletedProcess: Add boolean value

2020-11-25 Thread Guido van Rossum


Guido van Rossum  added the comment:

Greg, do you have an opinion here?

--
nosy: +gregory.p.smith

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



[issue29980] OSError: multiple exceptions should preserve the exception type if it is common

2020-11-25 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

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



[issue42102] Make builtins.callable "generic"

2020-11-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

No, they both have a different meaning. Object has (almost) no attributes. Any 
has all attributes.

--

___
Python tracker 
<https://bugs.python.org/issue42102>
___
___
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-11-22 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm still not sold on __args__ == (Tuple[int, int], str); it looks too weird.

However if we introduced a new private type for this purpose that might work? I 
see that the definition of Tuple in typing.py is

Tuple = _TupleType(tuple, -1, inst=False, name='Tuple')

Maybe we could do something like

_PosArgs = _TupleType(tuple, -1, inst=False, name='_PosArgs')

?

Then __args__ could be (_PosArgs[int, int], str).

However this still leaves collections.abc.Callable different. (We really don't 
want to import typing there.)

Then again, maybe we should still not rule out ((int, int), str)? It feels less 
hackish than the others.

And yet another solution would be to stick with (int, int, str) and change 
collections.abc.Callable to match that. Simple, and more backward compatible 
for users of the typing module (since no changes at all there).

--

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



[issue42102] Make builtins.callable "generic"

2020-11-22 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hm. Shantanu's list shows that the next thing we should make usable without 
importing typing is Any. (I haven't any idea how to do that other than just 
making it a builtin.) But after that we should definitely tackle Callable, and 
the obvious way to do it is to make callable indexable. But does that mean it 
has to be a type? I don't think so -- it just has to be an object whose class 
defines both __call__ and __getitem__. Pseudo code:

class callable:
def __call__(self, thing):
return hasattr(thing, "__call__")
def __getitem__(self, index):
# returns a types.GenericAlias instance
# (or a subclass thereof)

I honestly don't think that we should support isinstance(x, callable) even if 
some people think that that should work.

In any case, we should first answer the questions that are still open for issue 
42195 -- what should __args__ for [cC]allable[[int, int], str] be? (int, int, 
str) or ((int, int), str) or ([int, int], str) or (Tuple[int, int], str) are 
all still on the table. Please refer to that issue.

--

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



[issue42430] Windows py launcher default for shebang line is surprising

2020-11-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

I guess this explains it:

>>> for p in os.getenv("PATH").split(os.pathsep): print(p)
... 
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\Git\cmd
C:\Program Files\nodejs\
C:\ProgramData\chocolatey\bin

C:\Program Files\Microsoft VS Code Insiders\bin
C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\Scripts\
C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\
C:\Users\gvanrossum\AppData\Local\Microsoft\WindowsApps

C:\Users\gvanrossum\AppData\Local\Programs\Microsoft VS Code Insiders\bin
C:\Users\gvanrossum\AppData\Roaming\npm
>>>

--
resolution:  -> not a bug
stage: needs patch -> resolved
status: open -> closed

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



[issue42430] Windows py launcher default for shebang line is surprising

2020-11-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

Oops, I think I understand why.  The py launcher actually does a search for an 
interpreter named "python" and that turns out to be python 3.10.

Now my question becomes why py chooses a different default than that.

I don't have a py.ini file in either of the two places mentioned by "py -h", 
nor do I have a PY_PYTHON env var.  Maybe it's because I installed 3.9 last?

--

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



[issue42430] Windows py launcher default for shebang line is surprising

2020-11-21 Thread Guido van Rossum


New submission from Guido van Rossum :

I have 3.9 and 3.10 installed on my Windows box.

The py launcher runs Python 3.10 when invoked on a script starting with a 
shebang line

#!/usr/bin/env python

even though the default without a script is 3.9, as shown here:

PS C:\Users\gvanrossum\peps> py -0
Installed Pythons found by C:\WINDOWS\py.exe Launcher for Windows
 -3.9-64 *
 -3.8-64
 -3.7-64
 -3.6-64
 -3.5-64
 -3.4-64
 -3.10-64

PS C:\Users\gvanrossum\peps> py   
Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

PS C:\Users\gvanrossum\peps> 

This caused some confusion since I was running a script that imported a package 
that I had installed in the default interpreter but not in 3.10.

I am not using a virtual environment (yet :-).

Without the shebang line the 3.9 interpreter is used.

(Full disclosure: the script was pep2html.py, and the package was docutils.)

--
assignee: steve.dower
components: Windows
messages: 381590
nosy: gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Windows py launcher default for shebang line is surprising
versions: Python 3.10

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-20 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-19 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks everyone! Can I close this now?

--

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-18 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 4687338d0ed46e1f5f5060536becf8a96496bae7 by kj in branch 'master':
bpo-42345: Add whatsnew for typing.Literal in 3.10 (GH-23385)
https://github.com/python/cpython/commit/4687338d0ed46e1f5f5060536becf8a96496bae7


--

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-18 Thread Guido van Rossum


Guido van Rossum  added the comment:

We need to fix this to make __hash__ match __eq__.

--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

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



[issue42332] add __weakref__ to types.GenericAlias

2020-11-17 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-17 Thread Guido van Rossum

Guido van Rossum  added the comment:

I recommend adding a whatsnew entry too. You can just add it to this issue. 
Interestingly you’ll probably need two separate ones, for 3.9 and 3.10. That 
would become two separate PRs for master, the 3.9 one to be backported.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Guido van Rossum

Guido van Rossum  added the comment:

Let’s make sure this is all written up in whatsnew.

--

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Okay.

--

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Guido van Rossum

Guido van Rossum  added the comment:

Not in anything dict please.

Nagging question — is there sufficient difference between {x := y} and {x: y} ?

--

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



[issue42381] Allow unparenthesized walrus in set comprehensions

2020-11-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, I suppose the comprehensions should all have the same syntax inside their 
various brackets.

--

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



[issue42102] Make builtins.callable "generic"

2020-11-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Well, it's certainly no bug fix, but just as PEP 585 lets us write list[int] 
instead of typing.List[int], it could be considered useful to be able to write 
callable[[int, int], str] instead of typing.Callable[[int, int], str].

It's easy enough to make it work so that callable(x) returns a bool but 
callable[X, Y] returns a built-in subclass of types.GenericAlias (the built-in 
type).

That said, I don't have data about how popular Callable is compared to other 
types (Sequence/Iterable etc. which will remain in collections.abc). Maybe 
someone can do some grepping of popular projects?

--

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



[issue38506] Launcher for Windows (py.exe) may rank Python 3.xx (in the future) after 3.x

2020-11-16 Thread Guido van Rossum


Change by Guido van Rossum :


--
versions:  -Python 3.8, Python 3.9

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



[issue38506] Launcher for Windows (py.exe) may rank Python 3.xx (in the future) after 3.x

2020-11-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

You may call it cosmetic, but for me it's a matter of usability.

Nevertheless, given how you designed the installer, we can drop the backport.

--

___
Python tracker 
<https://bugs.python.org/issue38506>
___
___
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-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

In that case I prefer ((int, int), str), in case we ever end up needing to add 
additional parameters to Callable. I propose we first fix 
https://bugs.python.org/issue42102.

--

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



[issue42102] Make builtins.callable "generic"

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'd like to pursue this for real; other issues for callable have popped up, 
https://bugs.python.org/issue42195 and https://bugs.python.org/issue40494 
(https://bugs.python.org/issue40398 is also related but already fixed).

>From 42195 I learn that __args__ ought to be hashable. I would prefer it to 
>still be structured, e.g. callable[[int, str], float].__args__ should be 
>((int, str), float).

This means we have to change typing.Callable and collections.abc.Callable as 
well (the latter may share code with builtins.callable, but typing.Callable 
should probably stay separate, but returning the same structure).

--

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



[issue40494] collections.abc.Callable and type variables

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

>From https://bugs.python.org/issue42195 it looks like we need to create a 
>subclass just for Callable. See https://bugs.python.org/issue42102 and PR 
>22848.

--

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



[issue42153] doc: library imaplib a url not available

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Closing in anticipation of the backports landing.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue42153] doc: library imaplib a url not available

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset aa01011003bb855cd52abfd49f2443446590d913 by Yash Shete in branch 
'master':
bpo-42153 Fix link to IMAP documents in imaplib.rst (GH-23297)
https://github.com/python/cpython/commit/aa01011003bb855cd52abfd49f2443446590d913


--
nosy: +gvanrossum

___
Python tracker 
<https://bugs.python.org/issue42153>
___
___
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-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Also, maybe we should make builtins.callable generic as well?

--

___
Python tracker 
<https://bugs.python.org/issue42195>
___
___
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-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

@Hatfield-Dodds, if we changed typing.Callable to return ((int, int), str) but 
collections.abc.Callable continued to return ([int, int], str), would that 
suffice for your purposes?

--

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



[issue38506] Launcher for Windows (py.exe) may rank Python 3.xx (in the future) after 3.x

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Hm, actually I think this needs to be backported to 3.8 and 3.9 (at least) 
since IIUC whichever release is installed last (or first?) overwrites "py.exe", 
so if "py.exe" came from e.g. 3.9, and 3.10 is present, we still want it to 
sort that correctly.

--
versions: +Python 3.8, Python 3.9

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



[issue38506] Launcher for Windows (py.exe) may rank Python 3.xx (in the future) after 3.x

2020-11-15 Thread Guido van Rossum


Change by Guido van Rossum :


--
versions: +Python 3.10 -Python 3.9

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



[issue42365] Python launcher: sort order in "Installed versions" off with 3.10

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Oops. :-)

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed

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



[issue38506] Launcher for Windows (py.exe) may rank Python 3.xx (in the future) after 3.x

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

I think now's the time to fix it, given that we're two alphas into 3.10 
already. (I independently discovered this and filed it as issue 42365.)

--
nosy: +gvanrossum

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



[issue42280] The list of standard generic collections is incomplete

2020-11-15 Thread Guido van Rossum

Guido van Rossum  added the comment:

Let’s just close this, there are more important things to do.

--

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



[issue42317] Docs of `typing.get_args`: Mention that due to caching of typing generics the order of arguments for Unions can be different from the one of the returned tuple

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue42280] The list of standard generic collections is incomplete

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

I think the difference between the two lists is that not every generic type is 
a collection.

If we apply that standard, I think the contextlib and re classes need to be 
*removed* from the list (did I get that right?).

--

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, I think it makes sense to de-dupe args for Literal.

--

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



[issue42365] Python launcher: sort order in "Installed versions" off with 3.10

2020-11-15 Thread Guido van Rossum


New submission from Guido van Rossum :

I installed Python 3.10 on Windows and now the sort order of the versions 
printed by `py -0` is kind of weird:
```
Installed Pythons found by C:\WINDOWS\py.exe Launcher for Windows
 -3.9-64 *
 -3.8-64
 -3.7-64
 -3.6-64
 -3.5-64
 -3.10-64
```
I'm guessing we're going to have to parse the versions...

(I accidentally first reported this in 
https://github.com/brettcannon/python-launcher/issues/42.)

--
components: Windows
messages: 381049
nosy: gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Python launcher: sort order in "Installed versions" off with 3.10
type: behavior
versions: Python 3.10

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



[issue39168] Generic type subscription is a huge toll on Python performance

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

No worries. I tend to run each time it command at least three times before I 
trust the numbers. Professional bench markers also configure a machine without 
background tasks (email etc.).

--

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



[issue39168] Generic type subscription is a huge toll on Python performance

2020-11-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

@davidm

I don't see such a dramatic difference -- the generic version is a tad slower, 
but the difference is less than the variation between runs.

What platform are you using?  (I'm doing this on Windows.)

--

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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-13 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks for the quick fix. It works!

--

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



[issue42345] Equality of typing.Literal depends on the order of arguments

2020-11-13 Thread Guido van Rossum


Guido van Rossum  added the comment:

Probably the implementation focused on static typing, not runtime checking.

Can you come up with a PR for a fix?

--
stage:  -> needs patch
versions: +Python 3.10, Python 3.8

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



[issue40939] Remove the old parser

2020-11-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

Honestly that code seems poorly thought out. If running it returns -1, an 
exception was presumably reported, but not necessarily SyntaxError -- so 
parsing it may not produce an error at all.

The functionality needed is in PyRun_InteractiveOneObjectEx(), but that is not 
public. :-(

--

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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

Can you think of a fix? (Presumably restore some code that was deleted from 
3.9?)

--

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



[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

> Does anyone know why the treatment of unresolved references was changed in 
> 3.9?

Probably to prepare for 3.10, where `from _future__ import annotations` is the 
default.

> Also, I'm a bit puzzled about something from the previously mentioned Integer 
> class and its use of __future__.annotations. 
>
> Why is it possible to declare an Integer return type for the add() method, 
> but only possible to declare an "Integer" forward reference for the _() 
> method?

I don't know -- you might want to look through the source code of 
singledispatch. Maybe the flow through the initial decorator is different than 
the flow through register().

--

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



[issue42317] Docs of `typing.get_args`: Mention that due to caching of typing generics the order of arguments for Unions can be different from the one of the returned tuple

2020-11-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

Exactly!

--

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



[issue42332] add __weakref__ to types.GenericAlias

2020-11-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

I think it's reasonable to consider this a bug to be fixed.

--

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



[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

So the biggest difference I see is that ForwardRef._evaluate() has grown a 
recursive_guard argument in 3.9. This makes me think that in 3.8, only one 
level of evaluation was happening, and in 3.8, we keep evaluating until we 
don't see a string or ForwardRef.

The specific examples all happen at a point where the forward ref "C" cannot be 
resolved at all yet (since they're happening *in the class body*).

Possibly the best way out is to treat unresolved references differently, and 
just return the ForwardRef to the caller -- after all this is what the example 
does in 3.8.

--

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



[issue42329] typing classes do not have __name__ attributes in 3.7+

2020-11-12 Thread Guido van Rossum


Guido van Rossum  added the comment:

So shall we just close this?

--

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



[issue42329] typing classes do not have __name__ attributes in 3.7+

2020-11-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

Between 3.6 and 3.7 they stopped being types.

IIRC this enabled optimizations. (Serhiy?)

I don't think this is important, but I suppose you have some code that this 
breaks?

The name is passed to the constructor of _SpecialGenericAlias, so I'm fine with 
fixing this, though the backports may get tricky when you get down to 3.7.

--
nosy: +serhiy.storchaka

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



[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

FWIW here's a minimal demo:

from __future__ import annotations
from typing import get_type_hints

class C:
def func(self, a: "C"):
pass

print(get_type_hints(func))

In 3.8 this prints

{'a': ForwardRef('C')}

while in 3.9 it raises NameError:

Traceback (most recent call last):
  File "C:\Users\gvanrossum\cpython\t.py", line 4, in 
class C:
  File "C:\Users\gvanrossum\cpython\t.py", line 8, in C
print(get_type_hints(func))
  File "C:\Python39\lib\typing.py", line 1386, in get_type_hints
value = _eval_type(value, globalns, localns)
  File "C:\Python39\lib\typing.py", line 254, in _eval_type
return t._evaluate(globalns, localns, recursive_guard)
  File "C:\Python39\lib\typing.py", line 497, in _evaluate
self.__forward_value__ = _eval_type(
  File "C:\Python39\lib\typing.py", line 254, in _eval_type
return t._evaluate(globalns, localns, recursive_guard)
  File "C:\Python39\lib\typing.py", line 493, in _evaluate
eval(self.__forward_code__, globalns, localns),
  File "", line 1, in 
NameError: name 'C' is not defined

--

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



[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

Keep this issue.

--

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



[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-11-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

I spent some time debugging this looking for the root cause.

I think it looks like the recursion check in ForwardRef._evaluate() fails to 
trigger.  At some point recursive_guard is a frozen set containing "'Integer'" 
(i.e. a string whose first and last character are single quotes, while 
self.__forward_arg__ is 'Integer' (i.e. a string that does not contain quotes).

I'm running out of time for the rest of the investigation, so feel free to 
confirm this and go down the rabbit hole from there...

--

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



[issue42317] Docs of `typing.get_args`: Mention that due to caching of typing generics the order of arguments for Unions can be different from the one of the returned tuple

2020-11-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

Agreed it's mildly sad, and I wish the cache could preserve the order in 
List[Union[int, str]], but for that to work we'd have to change how the cache 
works, which feels complex, or we'd have to chance things so that Union[int, 
str] != Union[str, int], which seems wrong as well (and we've had them equal 
for many releases so this would break code).

Fixing the cache would require adding a new comparison method to all generic 
type objects, and that just doesn't seem worth the effort (but I'd be open to 
this solution in the future).

So for now, let's document that get_args() may swap Union arguments.

--
stage:  -> needs patch

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



[issue35712] Make NotImplemented unusable in boolean context

2020-11-09 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

So you're saying this war broken by 
https://github.com/python/cpython/pull/19087 ?

--

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



[issue35712] Make NotImplemented unusable in boolean context

2020-11-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

That's off topic for this issue -- you can go to python-ideas to propose that.

--

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



[issue35712] Make NotImplemented unusable in boolean context

2020-11-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

> list(filter(None.__ne__, L))

I assume you've been recommending this? To me it looks obfuscated. People 
should just use a comprehension, e.g.

[x for x in L if x is not None]

--

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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-09 Thread Guido van Rossum


Change by Guido van Rossum :


--
priority: normal -> release blocker

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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-09 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +serhiy.storchaka

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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-09 Thread Guido van Rossum


New submission from Guido van Rossum :

This code cannot be interrupted with ^C on Windows (e.g. in the REPL)

while True:
pass

This seems to be a regression, it works in earlier versions.

--
messages: 380597
nosy: Mark.Shannon, gvanrossum, steve.dower
priority: normal
severity: normal
status: open
title: Infinite loop uninterruptable on Windows in 3.10
versions: Python 3.10

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



[issue42296] Infinite loop uninterruptable on Windows in 3.10

2020-11-09 Thread Guido van Rossum


Change by Guido van Rossum :


--
components: +Windows
nosy: +paul.moore, tim.golden, zach.ware

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



[issue42233] GenericAlias does not support union type expressions

2020-11-08 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 4eb41d055e8307b8206f680287e492a6db068acd by kj in branch 'master':
bpo-42233: Add union type expression support for GenericAlias and fix 
de-duplicating of GenericAlias (GH-23077)
https://github.com/python/cpython/commit/4eb41d055e8307b8206f680287e492a6db068acd


--

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



[issue42288] typing.get_type_hints() returns Optional[Any] if the default value of the argument is None

2020-11-08 Thread Guido van Rossum


Guido van Rossum  added the comment:

There is actually a difference between Any and Optional[Any]. Try the following 
using e.g. mypy:

def f(a: Optional[Any]):
a+1

def g(a: Any):
a+1

You'll get an error in f but not in g.

So this behavior is not a bug.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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



[issue38119] resource tracker destroys shared memory segments when other processes should still have valid access

2020-11-06 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

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



[issue26031] Add stat caching option to pathlib

2020-11-04 Thread Guido van Rossum


Guido van Rossum  added the comment:

Okay, I am giving up on this.

--
resolution:  -> out of date
stage: test needed -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue26031>
___
___
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-11-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Actually you can't really change typing.Callable's __args__, because it must be 
hashable, and lists aren't.

If GenericAlias doesn't cache yet, it might very well do so in the future to 
gain some speed when e.g. list[int] is used at runtime outside annotations, 
e.g. in cast(), so it will be important there too.

--

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



[issue42198] Clean up docs for Union and GenericAlias

2020-10-31 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks Ken Ji for all your help! I'll close this now.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue42198] Clean up docs for Union and GenericAlias

2020-10-31 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 3bf0d02f2817c48b6ee61a95b52a6d76ad543be9 by kj in branch 'master':
bpo-42198: New section in stdtypes for type annotation types (GH-23063)
https://github.com/python/cpython/commit/3bf0d02f2817c48b6ee61a95b52a6d76ad543be9


--

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



[issue40814] Update typing module documentation based on PEP 585

2020-10-31 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue42198] Clean up docs for Union and GenericAlias

2020-10-31 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks for all your efforts, KJ! Can this issue be closed?

--

___
Python tracker 
<https://bugs.python.org/issue42198>
___
___
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-10-30 Thread Guido van Rossum


Guido van Rossum  added the comment:

@corona10 Do I hear that you'd like to work on this?

--

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



[issue42190] global declarations affect too much inside exec or compile

2020-10-30 Thread Guido van Rossum


Guido van Rossum  added the comment:

Looks like a bug. Maybe someone can bisect and find when this started happening?

--

___
Python tracker 
<https://bugs.python.org/issue42190>
___
___
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-10-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

Good find! I see that typing.Callable has adopted this structure precisely to 
enable caching.

We should see if we can fix _collections_abc.Callable. It's still early in the 
life of 3.9 so I think this is reasonable.

We'll need a subclass of GenericAlias so that the repr() of Callable[[int, 
int], int] still comes out correctly. This is similar to how typing.Callable 
solves it.

Do you feel up to submitting a PR for this? Otherwise maybe Batuhan feels like 
contributing a fix for this?

--
nosy: +BTaskaya

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



[issue41987] singledispatchmethod raises an error when relying on a forward declaration

2020-10-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm not an expert on singledispatch. It seems the get_type_hints() call is 
present in 3.8 as well.

Could you investigate and find a root cause? Then maybe we can fix it. (If you 
come up with a PR that would be very much appreciated.)

--
versions: +Python 3.9

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



[issue42187] Deprecating / removing token.ISTERMINAL/ISNONTERMINAL

2020-10-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

I thought for all?

--

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



[issue42187] Deprecating / removing token.ISTERMINAL/ISNONTERMINAL

2020-10-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Since there are so few projects, maybe you can just contact them?

--

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



[issue41805] types.GenericAlias and types.Union have no documentation

2020-10-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Cool. Please add me to the nosy list of any issues you open.

Also, if you're interesting helping out with the match statement, once the SC 
approves it, we'll need to add docs for that. See issue42128 for a possible 
plan.

--

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



[issue42128] Structural Pattern Matching (PEP 634)

2020-10-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

If you feel up to it, you might see if you could open a new, separate
(draft) PR that updates all those docs. (But you could also wait and see if
someone volunteers. There are some good doc writers active ATM.)

--

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



[issue41805] types.GenericAlias and types.Union have no documentation

2020-10-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks Ken Ji! Are you planning more doc patches?

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue41805] types.GenericAlias and types.Union have no documentation

2020-10-27 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 4173320920706b49a004b8d7108e8984e3fc by kj in branch 'master':
bpo-41805: Documentation for PEP 585 (GH-22615)
https://github.com/python/cpython/commit/4173320920706b49a004b8d7108e8984e3fc


--
nosy: +gvanrossum

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



[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> not a bug

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



[issue42169] Apparently all documentation on @typing.overload is wrong

2020-10-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

> The documentation for `typing.overload` says in a non-stub file the last 
> definition shouldn't be typed.

Incorrect. It doesn't say it shouldn't be *typed*, it says it shouldn't be 
*decorated with @overload*, which is a different thing.

The example is correct, since no annotation is the same as annotating with 
`Any`.

But with `mypy --strict`, no annotation causes an error, so if you are using 
that, you have to add *some* annotation (e.g. `Any`).

In your final example, the overloads are not redundant, since only the 
overloads tell the type checker that the output type corresponds to the input 
type.

For more information, please see Gitter (linked from the typing home page).

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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



[issue12737] str.title() is overzealous by upcasing combining marks inappropriately

2020-10-25 Thread Guido van Rossum

Guido van Rossum  added the comment:

Are you sure? Running Ezio's titletest.py, I get this output (note that the UCD 
major version is in the double digits so the test for that misfires :-).

titletest.py: Please set your PYTHONIOENCODING envariable to utf8
WARNING: Your old UCD is out of date, expected 6.0.0 but got 13.0.0
titlecase of  'déme un café'  should be  'Déme Un Café'  not  'DéMe Un 
Café'
titlecase of  'i̇stanbul'  should be  'İstanbul'  not  'İStanbul'
titlecase of  'ᾲ στο διάολο'  should be  'Ὰͅ Στο Διάολο'  not  'ᾺΙ Στο 
ΔιάΟλο'
failed 3 out of 6 tests

Note that the test program specifically uses combining marks, which are 
alternate ways to spell some characters. It seems what's failing is the second 
deme un cafe, the first istanbul, and the (only) greek phrase.

--

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



[issue42139] Synchronize What's New in 3.9 master and 3.9

2020-10-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Never mind, I read the diff backwards. You're all good and you can close this.

--

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



[issue42139] Synchronize What's New in 3.9 master and 3.9

2020-10-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

You also need to forward-port https://bugs.python.org/issue41950.

--

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



[issue42138] Forward port Doc/whatsnew/3.9.rst to master

2020-10-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Terry did the same thing in https://bugs.python.org/issue42139.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed

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



[issue42139] Synchronize What's New in 3.9 master and 3.9

2020-10-23 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 805ef73ad0ac4a77f3764dd17dfc959d562ce627 by Terry Jan Reedy in 
branch 'master':
bpo-42139: Update What's New 3.9 for master (#22936)
https://github.com/python/cpython/commit/805ef73ad0ac4a77f3764dd17dfc959d562ce627


--

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



[issue42138] Forward port Doc/whatsnew/3.9.rst to master

2020-10-23 Thread Guido van Rossum


Change by Guido van Rossum :


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

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



[issue42138] Forward port Doc/whatsnew/3.9.rst to master

2020-10-23 Thread Guido van Rossum


New submission from Guido van Rossum :

We discovered in issue41950 that the whatsnew/3.9.rst files differ quite a bit 
between 3.9 and master. IIUC this is (mostly) because Lukasz made a big pass 
updating it on occasion of the 3.9.0 release, and he did that in the 3.9 branch:
https://github.com/python/cpython/commit/9cf6752276e6fcfd0c23fdb064ad27f448aaaf75#diff-ec874d66bbcf13046b9928aa3716d14a93632f568b914eba32baf46ff4c9eb36R1180

Historically we've kept these docs in sync.

For someone with a bit of git knowledge this should be a simple thing (probably 
just cp that thing into master).

--
messages: 379501
nosy: gvanrossum, lukasz.langa
priority: normal
severity: normal
status: open
title: Forward port Doc/whatsnew/3.9.rst to master
versions: Python 3.10

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



[issue41950] Typo in Python 3.9 what's new page

2020-10-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks, merged, so closing.

I'll open a separate issue regarding the forward-porting of the 3.9 whatsnew.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

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



  1   2   3   4   5   6   7   8   9   10   >