The current annotations for the above functions mean that their key arguments can be omitted for iterables of objects that do not implement the rich comparison operators without triggering a type checker diagnostic, whereas that will likely fail with TypeError at runtime. They should be overloaded accordingly.
The current annotations for the above functions mean that their
keyarguments can be omitted for iterables of objects that do not implement the rich comparison operators without triggering a type checker diagnostic, whereas that will likely fail withTypeErrorat runtime. They should be overloaded accordingly.