我有这个代码:
from typing import Callable, Any
class Test(classmethod):
def __init__(self, f: Callable[..., Any]):
super().__init__(f)
def __get__(self,*args,**kwargs):
print(args) # why out put is (None, <class '__main__.A'>) where form none why no parameter 123
# where was it called
return super().__get__(*args,**kwargs)
class A:
@Test
def b(cls,v_b):
print(cls,v_b)
A.b(123)
Run Code Online (Sandbox Code Playgroud)
为什么输出是(None, <class '__main__.A'>)?它是从哪里来的?None为什么它不是我调用它的参数 123 ?