随笔分类 - python
摘要:class Vector: #类似于Iterable实现类 def __init__(self,data,choice): self.data=data self.choice=choice def __iter__(self): #实现后,取Iterator if self.choice==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
阅读全文

浙公网安备 33010602011771号