MCPcopy Create free account
hub / github.com/ActiveState/code / Vector

Class Vector

recipes/Python/205451_Povray_for_python/recipe-205451.py:35–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 self.file.write(" "*self.__indent+s+os.linesep)
34
35class Vector:
36 def __init__(self,*args):
37 if len(args) == 1:
38 self.v = args[0]
39 else:
40 self.v = args
41 def __str__(self):
42 return "<%s>"%(", ".join([str(x)for x in self.v]))
43 def __repr__(self):
44 return "Vector(%s)"%self.v
45 def __mul__(self,other):
46 return Vector( [r*other for r in self.v] )
47 def __rmul__(self,other):
48 return Vector( [r*other for r in self.v] )
49
50class Item:
51 def __init__(self,name,args=[],opts=[],**kwargs):

Callers 6

__mul__Method · 0.70
__rmul__Method · 0.70
__init__Method · 0.70
writeMethod · 0.70
__init__Method · 0.70
recipe-205451.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected