-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[red-knot] support narrowing on if x
and if not x
#14550
Comments
May I work on this? I noticed the comment about using an enum for narrowing (e.g., EliminateNonTruthy). Did you perhaps mean EliminateNonFalsy or EliminateTruthy instead?( Would it be simpler to just define it as Falsy? I feel that the enum name doesn't necessarily need to include the notion of negation. What do you think about this approach? If your intention is to emphasize that intersections with literals must always be negative, I can proceed as you suggested. |
@cake-monotone We have someone new starting next week and I think Carl created this task deliberately for them. That's why he assigned it to himself. |
Ah! I see! Thanks for your comment! I haven’t started working on it. |
I haven't done much typing work myself so I don't have a good sense for how "hard" some of these tasks are but if you're interested in contributing, you could consider tackling one of the special form tasks or take a look at any other task labeled with help-wanted |
@cake-monotone Micha is right about why I created this issue and assigned it to myself, but that said: if you are interested in working on this, please go ahead, that would be great! Given your past work I have no doubt you'll do a good job with it. We have plenty of things to work on, I won't have any trouble finding a replacement task for our new hire. (And this isn't one of the initial starter tasks, so they wouldn't have gotten to it for a few weeks anyway.) Please do confirm if you start working on it, and I will assign it to you. |
Regarding the naming, I think you are right, it will be clearer to use a name like I suggested in the description of this issue ( But the word "exclude" already serves that purpose, it's just confusing to use another negative beyond that. |
I got it. Thanks for clarifying and for your encouragement! I’ll start working on this—feel free to assign it to me. Also, thanks to MichaReiser for pointing out other potential tasks. I really appreciate it! |
This is trickier than it might appear; the complexities are discussed in #13694 (comment)
It will likely require adding a new method
Type::exclude_always_truthy
which returns a newType
that excludes all inhabitants of the previous type that are known to always be truthy.The text was updated successfully, but these errors were encountered: