Carl Meyer
Carl Meyer
I don't think we will likely do this for our upcoming beta release, but given the (somewhat surprising, to me) number of upvotes on the issue, maybe we should consider...
I think this is a rule that would fit better into a type-aware linter that we intend to eventually build on top of ty. It's not a type error in...
cc @TomerBin re #626
It seems like other type-checkers only consider `__setattr__` as a fallback, when there is otherwise no attribute of that name. This seems strange, since at runtime `__setattr__` always takes precedence....
I think ty is more capable than mypy in this case, not less -- but since this package was designed around mypy's behavior, the results with this package are worse....
This issue is sort of just the reincarnation of #309, except this is an example of a case where disabling `possibly-missing-import` rule doesn't help.
Our diagnostic is bad here and should be improved; the logic we attempt to use for detecting implicit shadowing of a function or class wrongly fires on assignments like this...
That's a great alternative if we can make it happen! I'm optimistic for `Intersection`; less clear for `Not`.
https://github.com/astral-sh/ruff/pull/18167 has some tests that may be useful to adapt, if/when we decide to do this.
Posted for discussion at https://discuss.python.org/t/when-should-we-assume-callable-types-are-method-descriptors/92938