-
Notifications
You must be signed in to change notification settings - Fork 133
Description
KnownFunction lets us detect particular functions that need to be handled specially in our type inference logic. We use this for things like is_subtype_of, to implement "evaluation" rules that are visible in the inferred return type of the function.
With our constraint set work, ty_extensions is become more complex, and now has a ConstraintSet type that we use in some return type annotations, and which has overridden dunder method for things like rich comparison and bool coercion.
There are also some functions that would ideally be implemented as methods on ConstraintSet. (And more are in the works!) But those are currently implemented as top-level functions in the ty_extensions module, since that is what works with our KnownFunction machinery.
It would be nice to extend KnownFunction to work with class methods too.