Python 3 and static typing

后端 未结 5 1013
别那么骄傲
别那么骄傲 2020-12-12 11:34

I didn\'t really pay as much attention to Python 3\'s development as I would have liked, and only just noticed some interesting new syntax changes. Specifically from this SO

5条回答
  •  攒了一身酷
    2020-12-12 12:13

    Sure, static typing seems a bit "unpythonic" and I don't use it all the time. But there are cases (e.g. nested classes, as in domain specific language parsing) where it can really speed up your development.

    Then I prefer using beartype explained in this post*. It comes with a git repo, tests and an explanation what it can and what it can't do ... and I like the name ;)

    * Please don't pay attention to Cecil's rant about why Python doesn't come with batteries included in this case.

提交回复
热议问题