astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
32.63k stars 1.09k forks source link

[red-knot] complete expression type inference #12701

Open carljm opened 3 months ago

carljm commented 3 months ago
mdbernard commented 1 month ago

Could you please clarify why some of these are currently blocked, and what actions would be needed to unblock them?

carljm commented 1 month ago

Could you please clarify why some of these are currently blocked, and what actions would be needed to unblock them?

Hi! Thanks for the nudge. Some of these are actually no longer blocked, because we already did the blocking thing! I've updated the list accordingly.

Some items are blocked by settling on a representation for generic types and handling of type variables in inference. I'm hoping to get to this in the next few weeks.

Some others aren't really blocked but are part of a larger project (for example, adding support for async Python and awaitables.)

If there are any particular items you're interested in working on, let me know and I'm happy to discuss in more detail.

TomerBin commented 1 month ago

Boolean expression can now be checked off ✅

cake-monotone commented 1 month ago

Would it be okay if I worked on the lambda expression? It doesn't seem to have any major blocking issues, and I think it would be a good starting point for my first contribution to red-knot. Please let me know if you have any other suggestions.

carljm commented 1 month ago

Would it be okay if I worked on the lambda expression? It doesn't seem to have any major blocking issues, and I think it would be a good starting point for my first contribution to red-knot. Please let me know if you have any other suggestions.

Thanks for your interest in contributing! Lambda expression inference would require adding a general Callable type, which we don't have yet, and is quite complex to implement; probably not a great first contribution. I think probably a good starter task would be fleshing out some missing support in unary/binary/compare expressions; see also https://github.com/astral-sh/ruff/issues/13618

cake-monotone commented 1 month ago

Thanks for your interest in contributing! Lambda expression inference would require adding a general Callable type, which we don't have yet, and is quite complex to implement; probably not a great first contribution. I think probably a good starter task would be fleshing out some missing support in unary/binary/compare expressions; see also #13618

Thank you for the helpful explanation! I’ll follow your suggestion and try working on the comparison task first :)