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

Sqla2 type hints iain #142

Merged
merged 3 commits into from
Sep 8, 2023
Merged

Sqla2 type hints iain #142

merged 3 commits into from
Sep 8, 2023

Conversation

Iain-S
Copy link
Collaborator

@Iain-S Iain-S commented Sep 7, 2023

Changes

  • Uses type hints and MagicMock(spec=MockedClass) feature to remove # type: ignore from tests. See https://stackoverflow.com/a/11283173/3324095
  • Uses the abstract Sequence in place of List and Mapping in place of Dict in function parameters as this allows a wider range of types to be passed in. Keeps concrete types for return types as they are more precise.
  • Swaps List for list and Dict for dict as we require Python >= 3.9 and this feature was added in 3.9.

@Iain-S Iain-S requested a review from mhauru September 7, 2023 18:32
@Iain-S Iain-S force-pushed the sqla2-type-hints-iain branch from 3aacd0e to 8eebb1c Compare September 7, 2023 18:42
@Iain-S Iain-S mentioned this pull request Sep 7, 2023
@mhauru mhauru changed the base branch from sqla2-type-hints to main September 8, 2023 08:44
Copy link
Collaborator

@mhauru mhauru left a comment

Choose a reason for hiding this comment

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

Nice!

@mhauru mhauru merged commit 130a156 into main Sep 8, 2023
@Iain-S Iain-S deleted the sqla2-type-hints-iain branch September 8, 2023 09:52
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.

2 participants