Re: [Python-Dev] PEP 549 v2: now titled Instance Descriptors

2017-09-08 Thread Ethan Furman
On 09/08/2017 01:45 PM, Ethan Furman wrote: I will admit I don't see what reassigning the __class__ attribute on a module did for us. Nathaniel Smith wrote: - > If you have an existing package that doesn't replace itself in > sys.modules, then it's difficult and risky to s

Re: [Python-Dev] PEP 549 v2: now titled Instance Descriptors

2017-09-08 Thread Nathaniel Smith
On Fri, Sep 8, 2017 at 1:45 PM, Ethan Furman wrote: > On 09/08/2017 12:44 PM, Larry Hastings wrote: > >> I've updated PEP 549 with a new title--"Instance Descriptors" is a better >> name than "Instance Properties"--and to >> clarify my rationale for the PEP. I've also updated the prototype with >

Re: [Python-Dev] PEP 549 v2: now titled Instance Descriptors

2017-09-08 Thread Larry Hastings
Assigning the module's __class__ means you can otherwise initialize your module instance normally--all your class needs to do is declare your properties or magic methods. If you overwrite the sys.modules entry for your module with a new instance of a custom subclass, all your module initiali

Re: [Python-Dev] PEP 549 v2: now titled Instance Descriptors

2017-09-08 Thread Ethan Furman
On 09/08/2017 12:44 PM, Larry Hastings wrote: I've updated PEP 549 with a new title--"Instance Descriptors" is a better name than "Instance Properties"--and to clarify my rationale for the PEP. I've also updated the prototype with code cleanups and a new type: "collections.abc.InstanceDescrip