Micha Reiser

Results 795 comments of Micha Reiser

@eli-schwartz This is expected. Ruff generally doesn't support any form of semantic narrowing. A few exceptions exist (`if typing.TYPE_CHECKING`) but `sys.version_info` checks are not. We're working on a new semantic...

Thanks for working on this. @dhruvmanila this overall seems reasonable to me. What do you think?

Could you explain what result you would expect or why the actual result is incorrect?

That makes sense. What's the reason for querying the module resolver with User instead of user?

That's correct, but I think that's an issue in the analyze graph because it first tries to resolve `models.User` before testing for `models` https://github.com/astral-sh/ruff/blob/3018303c8759b3e96d075c62eeb8b8ef24b4d0c3/crates/ruff_graph/src/resolver.rs#L27-L34 Red Knot does the resolution in...

The input of the module resolver isn't the name of a symbol. It's a module path. You have to use red knot's type checker if you want resolution by symbol.

A module path is a name of a module. E.g. `models` or `models.user` However, the module `models.user` is not the same as the symbol `models.user` * Module `models.user`: `models` is...

Thanks for opening this issue. I quickly checked, and Ruff doesn't yet implement the rule mentioned. This is most likely because it would require multifile analysis, or the rule would...

> Oh, I wasn't aware of lack of multi file analysis. Do you mean that if I incorrectly use a function/class/etc. defuned in module A in a different module B,...

Hmm, I didn't do anything specific other than starting VS code and opening a Python file but I'm now also unable to reproduce.