[Python-Dev] PEP 557: Data Classes

Mike Miller python-ideas at mgmiller.net
Sun Sep 10 17:05:45 EDT 2017


Thanks for the info.

On 2017-09-08 15:40, Eric V. Smith wrote:
>> - Are types required?
> 
> Annotations are required, the typing module is not.
> 
>>   Maybe an example or two with Any?
> 
> I'd rather leave it like it is: typing is referenced only once, for ClassVar.


Guess I really meant "object" or "type" above, not "typing.Any."

For a decade or two, my use of structs/records in Python has been 
dynamically-typed and that hasn't been an issue.  As the problem this PEP is 
solving is orthogonal to typing improvements, it feels a bit like typing is 
being coupled and pushed with it, whether wanted or not.

Not that I dislike typing mind you (appreciated on projects with large teams), 
it's just as mentioned not related to the problem of class definition verbosity 
or lacking functionality.

Cheers,
-Mike


More information about the Python-Dev mailing list