Sorry, something went wrong.
|
I think the refleaks are unrelated, probably #104510. |
Sorry, something went wrong.
|
I think the refleaks are unrelated, probably #104510. Yeah, you're right. |
Sorry, something went wrong.
|
🎉 |
Sorry, something went wrong.
|
Congrats! Really excellent work on a tight timeframe. |
Sorry, something went wrong.
|
Awesome! But will python support Multiple bounds like rust from typing import Protocol
class Dance(Protocol):
def dance(self): ...
class Sing(Protocol):
def sing(self): ...
def perform[P: Dance + Sing](person: P):
person.dance()
person.sing()
|
Sorry, something went wrong.
|
But will python support Multiple bounds like rust from typing import Protocol
class Dance(Protocol):
def dance(self): ...
class Sing(Protocol):
def sing(self): ...
def perform[P: Dance + Sing](person: P):
person.dance()
person.sing()
It will not, at least not soon. Changes like this often need a PEP. If you are interested in it, new ideas are welcomed at https://discuss.python.org/c/ideas/6. As for this specific question, I think you are asking for a typing.Intersection[Dance, Sing]. Some relevant issues here: python/typing#18 https://discuss.python.org/t/type-intersection-and-negation-in-type-annotations/23879 |
Sorry, something went wrong.
|
Adding the feature like a Multiple bounds by using a Intersection symbol and/or an & operator has been discussed for over 6 years at python/typing#213. I hope that the adoption of PEP695 will lead to more discussion on this as well and improve the representation of type hints. |
Sorry, something went wrong.
|
@python/organization-owners, please block @johnnyjeannatasha as a spammer — see the review on this PR and the comment at a390ec2#commitcomment-124994466 |
Sorry, something went wrong.
I will update this message as the status of the PR changes.
This is a complete implementation. It incorporates the changes in python/peps#3122, which were approved by the SC.
I wrote a detailed account of the changes in this PR at https://jellezijlstra.github.io/pep695
Reviews are welcome on any aspect of the implementation.