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

Return exact type from freeze_time() context manager #471

Open
mtvx opened this issue Oct 17, 2022 · 0 comments
Open

Return exact type from freeze_time() context manager #471

mtvx opened this issue Oct 17, 2022 · 0 comments

Comments

@mtvx
Copy link

mtvx commented Oct 17, 2022

with freeze_time() as factory:

factory can be either StepTickTimeFactory or FrozenDateTimeFactory. It's a bit annoying, because the two have slightly different APIs (e.g. tick() takes different types).

Could this one be more type friendly (I don't have suggestion... but somehow). Now, in order to satisfy mypy, one has the cast the factory into specific type, assert it, or smth?

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

No branches or pull requests

1 participant