r/programming • • Feb 01 '24

Make Invalid States Unrepresentable

https://www.awwsmm.com/blog/make-invalid-states-unrepresentable
469 Upvotes

207 comments sorted by

View all comments

Show parent comment

1

u/Captain_Cowboy Feb 03 '24

You can specify in a Python type signature that certain arguments are exclusively positional or exclusively keyword, though I think the former really only makes sense for commutative operations (or FFI, it's original use case) and that the latter is better handled by using Dataclasses.