🌐Meta methods
Meta methods are methods that can be defined on classes to overload operators or other specific behavior.
Below is a list of each meta method name along with it's corresponding operator (or functionality). Each operator listed is binary unless otherwise stated.
Operator overloading
add$-+sub$--mul$-*div$-/idiv$-//- same as(a / b).floorpow$-^- exponentation, not XORmod$-%gte$->=lte$-<=unm$--(unary)unp$-+(unary)size$-#bnot$-~(unary)band$-&bor$-|bshr$->>bxor$-~bshl$-<<
Other
to_string- calls when casting to string (e.x.<string>abcwill callabc->to_stringif it's a class instance)is_in$- calls when using anis inexpression (e.x.foo is in barwill callbar->is_in$(foo))
Last updated