Pair of methods for symmetric operator by a single definition

No. Typically you just define (update: fixed typo)

Base.:(==)(my::myInt, int::Int) = int == my

(Alternatively, you define a promote_rule to promote them both to myInt, and then define a single == rule for two myInt. Promotion rules are automatically symmetrized.)

2 Likes