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

2021-10-20 Thread Inada Naoki
On Thu, Oct 21, 2021 at 1:08 PM Henry Fredrick Schreiner wrote: > > > typing features from future Python versions > > I second both of these uses, but especially this (which seems to be missing > from the original post), it’s been by far the main reason I’ve used this mode > and I’ve seen this

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

2021-10-20 Thread Henry Fredrick Schreiner
> typing features from future Python versions I second both of these uses, but especially this (which seems to be missing from the original post), it’s been by far the main reason I’ve used this mode and I’ve seen this used, and is the main feature to look forward to when dropping Python 3.7

[Python-Dev] Re: Packing a long list of numbers into memory

2021-10-20 Thread Tim Peters
Sorry for the spam! A bunch of these were backed up in the moderation queue. I used the UI to set the list to auto-discard future messages from this address, but then clicked "Accept" in the mistaken sense of "yes, accept my request to auto-nuke this clown". But it took "Accept" to mean "sure

[Python-Dev] Re: Packing a long list of numbers into memory

2021-10-20 Thread joeevansjoe6
that is great to see this post . https://bit.ly/3C551OO ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at

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

2021-10-20 Thread Steven D'Aprano
On Tue, Oct 19, 2021 at 05:09:42PM -0700, Michael Selik wrote: > None and its ilk often conflate too many qualities. For example, is it > missing because it doesn't exist, it never existed, or because we never > received a value, despite knowing it must exist? Does it matter if different

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

2021-10-20 Thread Inada Naoki
On Thu, Oct 21, 2021 at 6:38 AM Christopher Barker wrote: > > Thanks to the SC for such a thoughtful note. I really like where this is > going. > > One thought. > > On Wed, Oct 20, 2021 at 6:21 AM Thomas Wouters wrote: >> >> Is the performance of PEP 649 and PEP 563 similar enough that we can

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

2021-10-20 Thread Piotr Waszkiewicz
On Wed, Oct 20, 2021 at 9:39 PM Michael Selik wrote: > > > On Wed, Oct 20, 2021 at 9:18 AM Piotr Waszkiewicz > wrote: > >> Do you think about something along those lines? >> ``` >> phone = book.publisher.owner.phone except AttributeError: None >> ``` >> > > Yes, that seems reasonable. > Nice,

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

2021-10-20 Thread Michael Selik
On Wed, Oct 20, 2021 at 9:18 AM Piotr Waszkiewicz wrote: > Do you think about something along those lines? > ``` > phone = book.publisher.owner.phone except AttributeError: None > ``` > Yes, that seems reasonable. > I don't mind this syntax but it would have to be supported by static type >

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

2021-10-20 Thread Christopher Barker
Thanks to the SC for such a thoughtful note. I really like where this is going. One thought. On Wed, Oct 20, 2021 at 6:21 AM Thomas Wouters wrote: > >1. > >Is the performance of PEP 649 and PEP 563 similar enough that we can >outright discount it as a concern? Does anyone actually

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

2021-10-20 Thread Piotr Waszkiewicz
Hi, On Wed, Oct 20, 2021 at 5:44 PM Michael Selik wrote: > On Wed, Oct 20, 2021 at 1:16 AM Piotr Waszkiewicz > wrote: > >> On Wed, Oct 20, 2021 at 2:33 AM Michael Selik wrote: >> >>> In case it saves anyone a couple clicks: >>> https://www.python.org/dev/peps/pep-0463/ >>> I also prefer more

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

2021-10-20 Thread Sebastian Rittau
I'm sorry, I sent my last mail too early. Here are the rest of my thoughts. Am 20.10.21 um 15:18 schrieb Thomas Wouters: Keeping the future import and stringified annotations around is certainly an option, but we’re worried about the cost of the implementation, the support cost, and the

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

2021-10-20 Thread Sebastian Rittau
Am 20.10.21 um 15:18 schrieb Thomas Wouters: By and large, the SC views PEP 649 as a better way forward. If PEP 563 had never come along, it would be a fairly easy decision to accept PEP 649. We are still inclined to accept PEP 649. That would leave the consideration about what to do with

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

2021-10-20 Thread Michael Selik
On Wed, Oct 20, 2021 at 1:16 AM Piotr Waszkiewicz wrote: > On Wed, Oct 20, 2021 at 2:33 AM Michael Selik wrote: > >> In case it saves anyone a couple clicks: >> https://www.python.org/dev/peps/pep-0463/ >> I also prefer more syntactic help with exceptions, rather than more >> syntax emphasizing

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

2021-10-20 Thread Piotr Waszkiewicz
Hi, On Wed, Oct 20, 2021 at 2:33 AM Michael Selik wrote: > In case it saves anyone a couple clicks: > https://www.python.org/dev/peps/pep-0463/ > > I also prefer more syntactic help with exceptions, rather than more syntax > emphasizing None's uniqueness. > Me too, but could you provide me an

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

2021-10-20 Thread Thomas Wouters
(For visibility, posted both to python-dev and Discourse.) Over the last couple of months, ever since delaying PEP 563’s default change in 3.10 , the Steering Council has been discussing and

[Python-Dev] Re: compiled python3.10 is unable to find _ssl

2021-10-20 Thread Christian Heimes
On 20/10/2021 09.43, Robin Becker wrote: On 19/10/2021 16:45, Christian Heimes wrote: We use the standard AX_CHECK_OPENSSL() m4 macro from autoconf-archive to detect OpenSSL. The macro uses pkg-config to detect OpenSSL. It doesn't check for specific version, though. We don't want to prevent

[Python-Dev] Re: PEP 670: Convert macros to functions in the Python C API

2021-10-20 Thread Petr Viktorin
On 20. 10. 21 3:15, Victor Stinner wrote: Extra info that I didn't put in the PEP to keep the PEP short. Since Python 3.8, multiple macros have already been converted, including Py_INCREF() and Py_TYPE() which are very commonly used and so matter for Python performance. Macros converted to

[Python-Dev] Re: compiled python3.10 is unable to find _ssl

2021-10-20 Thread Robin Becker
On 19/10/2021 16:45, Christian Heimes wrote: We use the standard AX_CHECK_OPENSSL() m4 macro from autoconf-archive to detect OpenSSL. The macro uses pkg-config to detect OpenSSL. It doesn't check for specific version, though. We don't want to prevent people with outdated OpenSSL or LibreSSL 

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

2021-10-20 Thread Rob Cliffe via Python-Dev
Data point: I find all the examples in PEP 505 less readable using the proposed new operators. Trying to explain why: The syntax feels *too* compact (Perl-like?) - when reading it, every time you see a None-aware operator (*if* you notice it), you have to jerk to a halt and say, "Whoa!  What's

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

2021-10-20 Thread Rob Cliffe via Python-Dev
This is very reminiscent of the (rejected) PEP 463, Exception-catching expressions (which I still hope will be resurrected some day).  It would allow you to write     y = (config["handler"]["parameters"]["y"] except KeyError: None) (possibly the parentheses might not be required) which IMO is