Skip to content
New issue

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

Use SaveHooks as explicit generic type alias #75

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

sobolevn
Copy link
Contributor

It is defined as SaveHooks = List[Callable[[T], None]], so we need to set T explicitly as SaveHooks[T]

Problem that my mypy detects:

tests/plugins/identity/verification.py:26: error: No overload variant of "m" of "Factory" matches argument type "Any"  [call-overload]
tests/plugins/identity/verification.py:26: note: Possible overload variants:
tests/plugins/identity/verification.py:26: note:     def m(self, model: str, pre_save: list[Callable[[Model], Any]] | None, post_save: list[Callable[[Model], Any]] | None, seed: Any | bytearray | int | None, quantity: None) -> Callable[..., Model]
tests/plugins/identity/verification.py:26: note:     def m(self, model: Any, pre_save: list[Callable[[Any], None]] | None, post_save: list[Callable[[Any], None]] | None, seed: Any | bytearray | int | None, quantity: None) -> Callable[..., Any]
tests/plugins/identity/verification.py:26: note:     def m(self, model: str, pre_save: list[Callable[[Model], Any]] | None, post_save: list[Callable[[Model], Any]] | None, seed: Any | bytearray | int | None, quantity: int | None) -> Callable[..., list[Model]]
tests/plugins/identity/verification.py:26: note:     def m(self, model: Any, pre_save: list[Callable[[Any], None]] | None, post_save: list[Callable[[Any], None]] | None, seed: Any | bytearray | int | None, quantity: int | None) -> Callable[..., list[Any]]

@coveralls
Copy link

Coverage Status

coverage: 90.855%. remained the same
when pulling d51b94b on sobolevn:patch-4
into f7414aa on fcurella:master.

Copy link
Owner

@fcurella fcurella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@fcurella fcurella merged commit 58771f8 into fcurella:master Jun 18, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants