[Python-Dev] Re: __init_subclass__ and metaclasses

2021-01-05 Thread Ethan Furman
On 1/5/21 10:25 AM, Guido van Rossum wrote: > On Tue, Jan 5, 2021 at 8:50 AM Ethan Furman wrote: >> [...] >> Perhaps `ABCMeta` can be easily fixed -- it is calling the function that >> records all abstract methods, etc., after the `type.__new__` call; can >> it be called before? > > Why do you ke

[Python-Dev] Re: __init_subclass__ and metaclasses

2021-01-05 Thread Guido van Rossum
On Tue, Jan 5, 2021 at 8:50 AM Ethan Furman wrote: > [...] > Perhaps `ABCMeta` can be easily fixed -- it is calling the function that > records all abstract methods, etc., after the > `type.__new__` call; can it be called before? > Why do you keep insisting that this is "broken"? Yes, you have i

[Python-Dev] Re: __init_subclass__ and metaclasses

2021-01-05 Thread Ethan Furman
On 1/5/21 4:22 AM, Nick Coghlan wrote: > On Wed, 30 Dec 2020 at 04:38, Ethan Furman wrote: >> ... there will be a few custom metaclasses that need to move some code >> from their `__new__` to `__init__` instead, and a few that need to add >> an `__init__` to consume any keyword arguments that don

[Python-Dev] Re: Dusting off PEP 533?

2021-01-05 Thread Stestagg
For what it's worth, this recent issue: https://bugs.python.org/issue42762 is somewhat related to the non-async aspect of 533. (generator func getting closed during __del__ and causing odd side-effects at seemingly random points in the execution flow) The example code provided in that issue is con

[Python-Dev] Re: Dusting off PEP 533?

2021-01-05 Thread Senthil Kumaran
Hi Paul, > Per PEP 525, I can call aclose coroutine method to cleanup the generator, but > it requires the code iterating to be aware that that closing the generator is > necessary. How about treating this as a bug for the specific use case that you mentioned, rather than a complete addition of "

[Python-Dev] Re: __init_subclass__ and metaclasses

2021-01-05 Thread Nick Coghlan
On Wed, 30 Dec 2020 at 04:38, Ethan Furman wrote: > > No, we can't. There is a window where the subclass is initialized after > > `typing_new()` returned before `__init__` > > starts, and you propose to move the subclass after that window. There may > > be code that depends on the class being >

[Python-Dev] Re: PEP 642 v3: Explicit patterns for structured pattern matching

2021-01-05 Thread Paul Sokolovsky
Hello, On Tue, 5 Jan 2021 20:37:27 +1000 Nick Coghlan wrote: > > > object(host=as host, port=as port}:", but that couldn't ever be I'd like to point out the weirdness of the "as" syntax when applied to positional arguments, e.g.: case [as x, as y]: case Cls(as x, as y): That feels unnatural,

[Python-Dev] Re: PEP 642 v3: Explicit patterns for structured pattern matching

2021-01-05 Thread Nick Coghlan
On Mon, 4 Jan 2021 at 18:38, Paul Moore wrote: > > On Sun, 3 Jan 2021 at 23:38, Nick Coghlan wrote: > > > > The instance attribute syntax arose from trying to deal with two problems > > from class patterns in PEP 634: > > > > * "ATTR=TARGET" using "=" to bind to the right instead of to the left

[Python-Dev] Re: Where is the SQLite module maintainer

2021-01-05 Thread Serhiy Storchaka
27.12.20 22:20, Erlend Aasland пише: > Who can help me review code that touches the sqlite3 module code base? > > > I've received a lot of constructive reviews from Victor Stinner, Dong-he > Na and Pablo Galindo on my past sqlite3 PR's; thank you so much! I still > feel uncomfortable requesting t