def __imul__(self, other):
"""
>>> g = GlyphCoordinates([(1,2)])
>>> g *= (2,.5)
>>> g *= 2
>>> g
GlyphCoordinates([(4.0, 2.0)])
>>> g = GlyphCoordinates([(1,2)])
>>> g *= 2
>>> g
GlyphCoordinates([(2, 4)])
"""
if isinstance(other, Number):
other = (other, other)
if isinstance(other, tuple):
if other == (1,1):
return self
assert len(other) == 2
self.scale(other)
return self
return NotImplemented
评论列表
文章目录