We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See example below
from fastcore.basics import patch, patch_to class KeywordArgumentsMixin: ... # NOTE: this works if uncommented # @classmethod # def get_class_keywords(cls:KeywordArgumentsMixin) -> list: # return inspect.getfullargspec(cls.__init__).kwonlyargs
@dataclass class Foo(KeywordArgumentsMixin): _: KW_ONLY a: int = 1 b: int = 2 c: int = 3 @dataclass class Qux(KeywordArgumentsMixin): _: KW_ONLY q: str = -2 u: str = -1 x: int = 0 #| export @dataclass class Bar(Foo): _: KW_ONLY x: int = 7 y: int = 8 z: int = 9 @dataclass class Baz(Bar, Qux): _: KW_ONLY a: int = 6 b: int = 7 q: int = 0
@patch(cls_method=True) def get_class_keywords(cls:KeywordArgumentsMixin) -> list: return inspect.getfullargspec(cls.__init__).kwonlyargs
list(c.get_class_keywords() for c in (Foo, Qux, Bar, Baz)) > [[], [], [], []]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
See example below
cell 1
cell 2
cell 3
cell 4
The text was updated successfully, but these errors were encountered: