fromtypingimportCallable, MutableMapping, ClassVarclassC:
x: ClassVar[Callable[[], MutableMapping]] =dictdeff(self) ->MutableMapping:
returnself.x() c=C()
print(c.f())
Gives
a.py:6: error: Attribute function "x" with type "Callable[[], MutableMapping[Any, Any]]" does not accept self argument
Gives