say I want to overload an operator (lets say +
for now) for some class I've created,
class A (object):
#code here
and then:
a = A()
b = A()
what would I do to define:
c = a + b
or something along those lines? (note: this question is purely theoretical I will likely use this at some time, just not currently (unless its really easy and I really need a use for it))
(p.s. if it is possible to do this for other things such as and
, or
, not
, str
, e.t.c.)