El sáb, 16 abr 2022 a las 12:51, John Hagen (<johnthagen@gmail.com>) escribió:
The original (superseded) PEP 622 proposed adding a @sealed decorator so that users could define algebraic data types (ADTs) that static type checkers could verify are `match`ed exhaustively:
- https://peps.python.org/pep-0622/#sealed-classes-as-algebraic-data-types
There is a somewhat fairly-upvoted question about ADTs in Python, indicating interest in this area:
- https://stackoverflow.com/questions/16258553
@sealed would be very valuable towards making ADT usage within Python more type-safe. Is there any historical discussion about why @sealed was dropped from the final pattern matching PEP?
I don't recall exactly, but my sense was that the original proposal was too big and complicated, so it was slimmed down into PEP 634. A number of non-essential features were dropped.
What would be the next steps needed to push this forward? Would writing a new PEP be the next step?
Yes, this would need to be a new PEP. I'd probably be willing to sponsor such a PEP.
_______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/ Member address: jelle.zijlstra@gmail.com