[Python-Dev] PEP 557: Data Classes (original) (raw)
Ethan Furman ethan at stoneleaf.us
Thu Oct 12 20:56:41 EDT 2017
- Previous message (by thread): [Python-Dev] PEP 557: Data Classes
- Next message (by thread): [Python-Dev] What is the design purpose of metaclasses vs code generating decorators? (was Re: PEP 557: Data Classes)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 10/12/2017 03:44 PM, Chris Barker wrote:
I think we've drifted into a new topic, but...
I was thinking about this last spring, when I tried to cram all sorts of python metaprogramming into one 3hr class...
Trying to come up with a an exam[ple for metclasses, I couldn't come up with anything that couldn't be done more claerly (to me) with a class decorator.
The Enum data type requires metaclasses.
Any time you want to modify the behavior of a class (not its instances, the class itself) you need a metaclass.
Agreed that it's pretty rare, but we need them.
--
Ethan
- Previous message (by thread): [Python-Dev] PEP 557: Data Classes
- Next message (by thread): [Python-Dev] What is the design purpose of metaclasses vs code generating decorators? (was Re: PEP 557: Data Classes)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]