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 ParamSpec in freezegun stubs #7053

Closed
wants to merge 1 commit into from

Conversation

AlexWaygood
Copy link
Member

No description provided.

def __enter__(self) -> FrozenDateTimeFactory | StepTickTimeFactory: ...
def __exit__(self, *args: Any) -> None: ...
def start(self) -> Any: ...
def stop(self) -> None: ...
def decorate_class(self, klass: type[_T]) -> _T: ...
def decorate_coroutine(self, coroutine: _T) -> _T: ...
def decorate_callable(self, func: Callable[..., _T]) -> Callable[..., _T]: ...
def decorate_callable(self, func: Callable[_P, _T]) -> Callable[_P, _T]: ...
Copy link
Member

Choose a reason for hiding this comment

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

This isn't correct: if as_arg or as_kwarg is given, it injects an additional arg/kwarg. https://github.com/spulec/freezegun/blob/8994558274161b527ab83a3b13ea5969e9ebd144/freezegun/api.py#L783

This also applies to the __call__ overload for functions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay. Best to leave it until we have Concatenate support, then?

Copy link
Member

Choose a reason for hiding this comment

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

That's not enough for the kwarg.

@JelleZijlstra
Copy link
Member

I also noticed the library has a py.typed, so we may be able to remove the stubs at some point.

@AlexWaygood AlexWaygood deleted the patch-4 branch January 27, 2022 16:06
@AlexWaygood
Copy link
Member Author

AlexWaygood commented Jan 27, 2022

I also noticed the library has a py.typed, so we may be able to remove the stubs at some point.

Looks to me like the py.typed file was added 7 months ago, so can we just remove the stubs immediately?

^We can't, that's just the unreleased master branch, no released version has a py.typed marker yet. My bad.

@srittau
Copy link
Collaborator

srittau commented Jan 27, 2022

We already have an issue for that: #5842.

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