摘要:
''' 预备知识: …… @decorator def f(*args,**kwargs): pass # 此处@decorator 等价于 f = decorator(f) @decorator2(*args,**kwargs) def f2(*args,**kwargs): pass # 此处@ 阅读全文
摘要:
赋值语句: 相当于: 但不必显式写出临时变量t就可以赋值。 阅读全文
摘要:
先来段小程序class Foo: name = "abc" def __init__(self,age): self.age = ageprint(Foo.name)Foo.name = "bcd"print(Foo.name)Foo.age = 18print(Foo.age)x = Foo(20 阅读全文