Hacker News new | ask | show | jobs
by TristanDaCunha 1809 days ago
> Using @cached_property feels like a bad code smell and it’s a controversial design decision

Why?

1 comments

It’s just a smell. It hints that instead of passing the instance, one should instead be passing the output of the function.

It also doesn’t really matter. The only time things like this have actually been important was in giant Java codebases, where attempts were made to keep packages cleanly separated (and so therefore passing the simplest possible public types reduces the amount of public classes).