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

fix: fix typing of from_dict and other classmethods #408

Merged
merged 6 commits into from
Jun 16, 2022

Conversation

mvadari
Copy link
Collaborator

@mvadari mvadari commented Jun 16, 2022

High Level Overview of Change

This PR uses TypeVar to make the typing of from_dict and other similar constructor class methods work as expected.

Context of Change

I was getting really annoyed by it - it required a lot of unnecessary casts.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Test Plan

mypy passes.

Sorry, something went wrong.

@mvadari mvadari requested review from ckniffen, JST5000 and khancode June 16, 2022 15:58
Copy link
Contributor

@JST5000 JST5000 left a comment

Choose a reason for hiding this comment

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

LGTM

@mvadari mvadari force-pushed the inheritance-types branch from 0c4925a to 3b9590c Compare June 16, 2022 20:59
@mvadari mvadari force-pushed the inheritance-types branch from 3b9590c to cd8574d Compare June 16, 2022 21:11
@mvadari mvadari merged commit 521988c into master Jun 16, 2022
@mvadari mvadari deleted the inheritance-types branch June 16, 2022 21:35
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.

None yet

3 participants