随笔分类 -  python

摘要:class Vector: #类似于Iterable实现类 def __init__(self,data,choice): self.data=data self.choice=choice def __iter__(self): #实现后,取Iterator if self.choice==0: 阅读全文
posted @ 2020-06-01 16:38 tonnysz 阅读(134) 评论(0) 推荐(0)
摘要:import torchclass A: def __init__(self,ax): print("%s in A" % ax) print("%s in y.B" % self.y)class B(A): def __init__(self,bx): self.y=200; #三者相同 # su 阅读全文
posted @ 2020-05-19 23:47 tonnysz 阅读(228) 评论(0) 推荐(0)