A newbie question

Matimus mccredie at gmail.com
Mon May 21 19:21:20 EDT 2007


How about this:
[code]
    def __add__(self,x):
        return Cc14(self.r+x.r, self.i+x.i)
[/code]

However... Are you aware that Python has built in support for complex
numbers already?

>>> x = 4+5j
>>> y = 4+5j
>>> x+y
(8+10j)
>>>




More information about the Python-list mailing list