-
Notifications
You must be signed in to change notification settings - Fork 233
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
SupportsComplex and SupportsBytes? #68
Comments
I'm lukewarm. I haven't really followed the use cases for SupportsInt. Also, is there a deep difference between these and collection.abc's Hashable, Iterable, Iterator, Sized, Container, which represent similar ideas but with one-off implementations? (And am I the only one confused by the fact that most of the SupportsXXX classes are named after a built-in type?) |
There is no deep difference -- they are similar to If we didn't have those types, how would we specify that If we supported structural subtyping, we could easily just define internal, anonymous structural types for these functions and not expose them at all in typing. We can actually still kind of do that even without structural subtyping -- we could define types such as I'm not attached to the naming of these types -- if I remember correctly, it was you who proposed this convention :-) I can't think of a good name similar to |
OK, I think it's fine to add a few more, I'll add bytes and complex. If we find we need a lot more of these we should rethink this though. |
Closed by revision a8cd08d. However, I noticed that |
I filed http://bugs.python.org/issue24234 for the issue about eponymous methods. |
Similar to SupportsInt and SupportsFloat, should typing define SupportsComplex and SupportsBytes?
For example:
The text was updated successfully, but these errors were encountered: