#NEWLINE# def __add__( self , other ) : #NEWLINE# #INDENT# if isinstance ( other , Vec2d ) : #NEWLINE# #INDENT# return Vec2d ( ( self . x + other . x ) , ( self . y + other . y ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( other , '__getitem__' ) : #NEWLINE# #INDENT# return Vec2d ( ( self . x + other [ 0 ] ) , ( self . y + other [ 1 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return Vec2d ( ( self . x + other ) , ( self . y + other ) )