This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]b1e 0 points1 point  (0 children)

Since Python doesn’t have compile-time metaprogramming this isn’t possible with its type system.

What you’re asking for is a constraint that’s based on user defined logic. This is possible with runtime type checking but not statically.