Re:Static Duck Typing in Python with Protocols
by dragonwriter on Tuesday November 23, 2021 @12:14PM
(#29320344)
Its a library design rather than a language design thing. You could make a separate class Size and Point that both take an (int, int) constructor, and even have BoundingBox whose constructor takes (Point, Point), and the function could take a BoundingBox instead of a list of tuples. Of course, you can do that in Python, just as well.
[ Parent
| on HN ]
There are no comments on this comment yet.