-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Description
If a class with __call__ can be a subtype of Callable (#3132 implements this behavior), the fallback of Callable types should probably be object. For function objects defined using def, it's perhaps still fine to use a different callback.
Additionally, callable protocol members should probably all have a object as the fallback, even those defined using def. A concrete subtype of a protocol could implement a method using an instance of a user-defined class with __call__, which could effectively have an arbitrary fallback type.
More discussion: #3132 (comment)
cc @ilevkivskyi