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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Understanding Decorators in Python

5 点作者 bascodes大约 3 年前

1 comment

tabtab大约 3 年前
I&#x27;m gonna take vote hits, but truth is needed here. Python Decorators and C#&#x2F;Java &quot;attributes&quot; are a sham. If their OOP model were powerful enough, they could just use OOP composition to get the same thing and not have to invent a new kind of thing: it would all just be objects referencing objects. They are a sign of poor or obsolete language design.<p>True, it&#x27;s hard to just throw everything out and start over, but at least <i>recognize</i> the problem so that next generation of languages can solve&#x2F;avoid it.<p>Removing or softening the distinction between object and class is perhaps a start.
评论 #30457699 未加载