TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

PEP-526: Syntax for Variable and Attribute Annotations

4 点作者 Spiritus超过 8 年前

1 comment

scrollaway超过 8 年前
I&#x27;m really not liking this shoehorned type annotation system. It&#x27;s a significant decrease in readability.<p>On top of that, the fact that there is no builtin benefit within the language of using type annotations slows down its adoption <i>greatly</i>.<p>I wish some of the typescript lessons would have been learned. Typescript <i>really</i> got optional typing right. But instead we&#x27;re left with a system which requires imports, abuses __getitem__ syntax and yields no benefits out of the box. All that because nobody wants to touch the parser -- the same sort of bad decisions which has led to the awful lambda syntax staying there so long.<p>And the worst part is, from there I see no path to a proper type system that doesn&#x27;t massively break backwards compatibility. Mishandling such a core feature could kill the language.