Skip to content
Discussion options

You must be logged in to vote

At the core, optype consists of single-method (and some single-attribute) protocols. So in that sense your Ordinals protocol could be expressed (using some imaginary syntax) as something like op.CanLe[Self, bool] & op.CanLt[Self, bool]. Once #650 is implemented, we could write this in valid Python as

import optype as op

class Ordinals(op.CanLeSame[bool], op.CanLtSame[bool]): ...

BTW, if between吗 is all that Ordinals is used for, then the __lt__ shouldn't be necessary, and a op.CanLeSame would suffice.

Does that answer your question?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hunterhogan
Comment options

Answer selected by hunterhogan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants