[Python-Dev] Is static typing still optional?

Eric V. Smith eric at trueblade.com
Wed Dec 20 20:29:41 EST 2017


On 12/20/2017 8:13 PM, Eric V. Smith wrote:

>> There is definitely a passive bias towards using types with 
>> dataclasses in that the Eric (the author) doesn't appear to want an 
>> example without them in the pep/docs.
> 
> I'm not sure what such an example would look like. Do you mean without 
> annotations? Or do you mean without specifying the "correct" type, like:
> 
> @dataclass
> class C:
>     x: int = 'hello world'
> 
> ?
> 
> Or something else?
> 
> Can you provide an example of what you'd like to see?

Re-reading my post you referenced, is it just an example using 
typing.Any? I'm okay with that in the docs, I just didn't want to focus 
on it in the PEP. I want the PEP to only have the one reference to 
typing, for typing.ClassVar. I figure the people reading the PEP can 
extrapolate to all of the possible uses for annotations that they don't 
need to see a typing.Any example.

Eric.


More information about the Python-Dev mailing list