[Python-Dev] Is static typing still optional? (original) (raw)
Chris Barker chris.barker at noaa.gov
Fri Dec 22 14:38:06 EST 2017
- Previous message (by thread): [Python-Dev] Is static typing still optional?
- Next message (by thread): [Python-Dev] Is static typing still optional?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Dec 22, 2017 at 8:49 AM, Brett Cannon <brett at python.org> wrote:
I think it's worth reminding people that if they don't like the fact
dataclasses (ab)use type hints for their succinct syntax that you can always use attrs instead to avoid type hints.
sure -- but this doesn't really address the issue, the whole reason this is even a discussion is because dataclasses is going into the standard library. Third party packages can do whatever they want, of course.
And the concern is that people (in particular newbies) will get confused / the wrong impression / other-negative-response by the (semi) use of typing in a standard library module.
As for those who feel dataclasses will force them to teach type hints and they simply don't want to, maybe we could help land protocols
Could you please clarify what this is about ???
But I think the key point I want to make is Guido chose dataclasses to support using the type hints syntax specifically over how attrs does things, so I don't see this thread trying to work around that going anywhere at this point since I haven't seen a solid alternative be proposed after all of this debating.
And the PEP has been approved.
So the actionable things are:
Writing good docs
Converging on a "recommended" way to do non-typed dataclass fields.
And that should be decided in order to write the docs, (and probably should be in the PEP).
-CHB
--
Christopher Barker, Ph.D. Oceanographer
Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20171222/a23eb091/attachment-0001.html>
- Previous message (by thread): [Python-Dev] Is static typing still optional?
- Next message (by thread): [Python-Dev] Is static typing still optional?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]