[Python-Dev] Re: PEP 678: Enriching Exceptions with Notes

2022-04-11 Thread Gregory P. Smith
On Thu, Jan 27, 2022 at 10:10 AM Zac Hatfield Dodds < zac.hatfield.do...@gmail.com> wrote: > Hi all, > > I've written PEP 678, proposing the addition of a __note__ attribute > which can be used to enrich displayed exceptions. This is particularly > useful with ExceptionGroup, or where exception

[Python-Dev] Re: PEP 687 – Isolating modules in the standard library

2022-04-11 Thread Nick Coghlan
On Tue, 12 Apr 2022, 3:59 am Guido van Rossum, wrote: > In the sentence starting with > > Types whose methods need access to their module instance will be converted > to heap types[...] > > please emphasize (bold!) "whose methods need access to their module > instance". > > Also emphasize this

[Python-Dev] Re: Lazy Imports [was: Declarative imports]

2022-04-11 Thread Barry Warsaw
On Apr 11, 2022, at 13:10, Guido van Rossum wrote: > > On Mon, Apr 11, 2022 at 1:07 PM Itamar O wrote: > Breaking out the discussion about lazy imports. > It seems somewhat OT in the declarative imports thread. > > Yes and Yes (at least for the "thinking about" part). > Germán Méndez Bravo

[Python-Dev] Re: Importing a submodule doesn't always set an attribute on its parent

2022-04-11 Thread dfremont--- via Python-Dev
Brett Cannon wrote: > So we don't want to strengthen the definition at > all; best we are comfortable with is put up a warning that you don't want > to do stuff with sys.modules unless you know what you're doing. OK, thanks for the clarification. Having read through the source of importlib one

[Python-Dev] Re: Declarative imports

2022-04-11 Thread Brett Cannon
On Sun, Apr 10, 2022 at 2:39 AM Daniel Pope wrote: > On Fri, 8 Apr 2022, 17:44 Guido van Rossum, wrote: > >> The interesting idea here seems to make "lazy imports" easier to >> implement by making them explicit in the code. So far, most lazy import >> frameworks for Python have done hacks with

[Python-Dev] Re: Importing a submodule doesn't always set an attribute on its parent

2022-04-11 Thread Brett Cannon
On Sat, Apr 9, 2022 at 1:53 PM dfremont--- via Python-Dev < python-dev@python.org> wrote: > Thanks, Brett. I understand why the behavior happens, I just don't > understand the decision to implement imports this way. Since there's no > warning in the documentation that removing items from

[Python-Dev] Re: Lazy Imports [was: Declarative imports]

2022-04-11 Thread Guido van Rossum
On Mon, Apr 11, 2022 at 1:07 PM Itamar O wrote: > Breaking out the discussion about lazy imports. > It seems somewhat OT in the declarative imports thread. > > On Mon, Apr 11, 2022 at 10:50 AM Barry Warsaw wrote: > >> Thanks Carl, >> >> > On Apr 9, 2022, at 08:25, Carl Meyer wrote: >> > >> >

[Python-Dev] RFC on PEP 681: Data Class Transforms

2022-04-11 Thread Erik De Bonte via Python-Dev
PEP 681 improves type checker support for libraries with dataclass-like behaviors by introducing a way to map the behaviors of decorators and classes in those libraries to the behaviors of stdlib dataclass. The PEP will not affect CPython directly

[Python-Dev] Lazy Imports [was: Declarative imports]

2022-04-11 Thread Itamar O
Breaking out the discussion about lazy imports. It seems somewhat OT in the declarative imports thread. On Mon, Apr 11, 2022 at 10:50 AM Barry Warsaw wrote: > Thanks Carl, > > > On Apr 9, 2022, at 08:25, Carl Meyer wrote: > > > > Our experience in practice, though, has been that universally

[Python-Dev] Re: PEP 687 – Isolating modules in the standard library

2022-04-11 Thread Guido van Rossum
In the sentence starting with Types whose methods need access to their module instance will be converted to heap types[...] please emphasize (bold!) "whose methods need access to their module instance". Also emphasize this paragraph: "Static types that do not need module state access, and have

[Python-Dev] Re: Declarative imports

2022-04-11 Thread Barry Warsaw
Thanks Carl, > On Apr 9, 2022, at 08:25, Carl Meyer wrote: > > Our experience in practice, though, has been that universally lazy > imports is somewhat easier to adopt than Strict Modules, and has had a > much bigger overall impact on reducing startup time for big CLIs (and > a big web server

[Python-Dev] Re: Need gh-13143 (bpo-34975: Add start_tls() method to streams API) to be merged

2022-04-11 Thread Jelle Zijlstra
El lun, 11 abr 2022 a las 9:10, Oleg Iarygin () escribió: > Hi everyone, > > Can PR gh-13143 be reopened and reviewed/merged when possible? It was > closed in favor of the new asyncio streams API (gh-13251). Later, the API > was cleanly removed (gh-16482) so the proposed PR became relevant again.

[Python-Dev] Need gh-13143 (bpo-34975: Add start_tls() method to streams API) to be merged

2022-04-11 Thread Oleg Iarygin
Hi everyone, Can PR gh-13143 be reopened and reviewed/merged when possible? It was closed in favor of the new asyncio streams API (gh-13251). Later, the API was cleanly removed (gh-16482) so the proposed PR became relevant again. The added method allows to turn encryption on on demand (and

[Python-Dev] Re: Declarative imports

2022-04-11 Thread Patrick Reader
On 10/04/2022 15:52, Guido van Rossum wrote: On Sun, Apr 10, 2022 at 2:31 AM Daniel Pope wrote: On Fri, 8 Apr 2022, 17:44 Guido van Rossum, wrote: The interesting idea here seems to make "lazy imports" easier to implement by making them explicit in the code. So far, most

[Python-Dev] PEP 687 – Isolating modules in the standard library

2022-04-11 Thread Petr Viktorin
Hello, Please provide any feedback you might have on PEP 687 – Isolating modules in the standard library: https://peps.python.org/pep-0687/ From recent discussions around “what should have a PEP”, it’s clear that this should have been a PEP long ago. Better late than never, I guess! We

[Python-Dev] Re: Importing a submodule doesn't always set an attribute on its parent

2022-04-11 Thread Nick Coghlan
On Sun, 10 Apr 2022, 8:44 am Eric V. Smith, wrote: > On 4/9/2022 4:28 PM, Terry Reedy wrote: > > On 4/9/2022 5:09 AM, Arfrever Frehtes Taifersar Arahesis wrote: > >> > >> Not only deletion, but also random assignments: > > > > Ok. Change "Manual deletion of entries from sys.modules" to "Direct