[Python-Dev] Summary of Python tracker Issues

2021-10-22 Thread Python tracker
ACTIVITY SUMMARY (2021-10-15 - 2021-10-22) Python tracker at https://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open7199 (-202) closed 50111 (+289) total 57310 (+87) Open issues

[Python-Dev] Re: PEP 505 (None-aware operators) for Python 3.11

2021-10-22 Thread Marc Mueller
Most of the discussion so far has been focused on (?.). Tbh though, I'm more interested in (??) and (??=). Just reading through code, I constantly notice boilerplate like this which could easily be substituted. variable = some_function(...) if variable is None: variable = [] # some default

[Python-Dev] Re: PEP 505 (None-aware operators) for Python 3.11

2021-10-22 Thread Chris Angelico
On Sat, Oct 23, 2021 at 6:20 AM Marc Mueller wrote: > > Most of the discussion so far has been focused on (?.). Tbh though, I'm more > interested in (??) and (??=). Just reading through code, I constantly notice > boilerplate like this which could easily be substituted. > > variable = some_funct

[Python-Dev] Re: Type annotations, PEP 649 and PEP 563

2021-10-22 Thread Jim J. Jewett
Larry Hastings wrote: > In Python, if you evaluate an undefined name, Python raises a > NameError.  This is so consistent I'm willing to call it a "rule".  Would it help the think of the function creation as catching that exception, and then finishing construction with its own version of NaN?

[Python-Dev] Re: Type annotations, PEP 649 and PEP 563

2021-10-22 Thread Bluenix
Hello! > This would affect code that expects annotations to always be strings, but such > code would have to be poking directly at function objects (the > __annotations__ attribute), instead of using the advertised ways of getting > at annotations (like typing.get_type_hints()). I would speculat

[Python-Dev] Re: Type annotations, PEP 649 and PEP 563

2021-10-22 Thread Steven D'Aprano
On Thu, Oct 21, 2021 at 09:36:20PM -0700, Christopher Barker wrote: > On Thu, Oct 21, 2021 at 5:24 PM Steven D'Aprano wrote: > > > Runtime type checkers already have to deal with forward refs that are > > strings, as this is legal, and always will be: > > > > def function(arg:'Spam') -> Any:

[Python-Dev] Re: Type annotations, PEP 649 and PEP 563

2021-10-22 Thread Christopher Barker
> Any other runtime annotation tool has to support strings, otherwise the > "from __future__ import annotations" directive will have already broken > it. Exactly- isn’t that it was deferred in 3.10, and may never be implemented? I’ll leave it to the Pydantic developers to discuss that, but they w