Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以建议一个使用场景:
super(type,type2)
我只能想到一种情况,即我想在超类中调用类似命名的 classmethod 方法,type同时也存在同名的方法type2。
type
type2
它主要用于__new__:
__new__
class MyStr(str): def __new__(cls, val): return super(MyStr, cls).__new__(cls, val.upper())