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

Add generic self type hint to Transaction #991

Merged
merged 3 commits into from Nov 11, 2021
Merged

Add generic self type hint to Transaction #991

merged 3 commits into from Nov 11, 2021

Conversation

schneidemar
Copy link
Contributor

This should fix #916, as the enter method now returns the correct subclass from which it was called.

I created a testcase to mypy tests, but I think it's not really testing anything yet. I would be glad to get help on proper test implementation.

This should fix #916, as the __enter__ method now returns the correct
subclass from which it was called.
tests/test_mypy.py Outdated Show resolved Hide resolved
pynamodb/transactions.py Outdated Show resolved Hide resolved
pynamodb/transactions.py Outdated Show resolved Hide resolved
pynamodb/transactions.py Outdated Show resolved Hide resolved
schneidemar and others added 2 commits November 3, 2021 16:36
Co-authored-by: Ilya Konstantinov <ilya.konstantinov@gmail.com>
Co-authored-by: Ilya Konstantinov <ilya.konstantinov@gmail.com>
@garrettheel garrettheel merged commit 918f98a into pynamodb:master Nov 11, 2021
@garrettheel
Copy link
Member

Thanks @schneidemar

@garrettheel garrettheel mentioned this pull request Jan 3, 2022
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.

Incomplete Typing with Transaction context managers
3 participants