TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Understanding Decorators in Python

5 pointsby bascodesabout 3 years ago

1 comment

tabtababout 3 years ago
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 未加载