NameError: name 'Vector2' is not defined
在这一行:
def Translate (self, pos: Vector2):
为什么Python无法在Translate方法中识别我的Vector2类?
class Vector2:
def __init__(self, x: float, y: float):
self.x = x
self.y = y
def Translate(self, pos: Vector2):
self.x += pos.x
self.y += pos.y
本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/python-shiyongleizuoweiqifangfazhongcanshudeleixingti.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:9月 16, 2019 at 08:53 下午