`<:` kind of notation would look more clear, I agree.

My proposition came after thinking the wording used in Python. 

issubclass() - is subclass?

By definition, subclass reminds me set theory. 
https://en.wikipedia.org/wiki/Subclass_(set_theory) which also has a relativity 
with Subtyping as Guido pointed out. 

And, we have operator support for set() as you can see here 
https://docs.python.org/3/library/stdtypes.html#set
`set <= other`

With this logic, since Python has its own way of being practical and 
predictable in some ways, I would except to have an operator like `<:`, which 
some other languages already possess. 

A <: B against issubclass(A, B)  looks more elegant, and purpose driven syntax 
like most of other types.

I see that there is also `issubset` method which is equivalent to `set <= 
other`. Therefore I find this a little bit inconsistent that we don't apply the 
similar logic for issubclass. 

I don't know if we could achieve same performance of issubclass itself with the 
operator (I think we can) but even it's not the case, people who uses Python to 
write their scripts very fast, that would be a lovely addition.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/BPDNTSZRRKBIXYJVKHNPG6EFZGDX4ZRX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to