Skip to content

Annotate deprecated_args decorator to preserve wrapped function type signature #3701

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mharding-hpe
Copy link

@mharding-hpe mharding-hpe commented Jul 7, 2025

Pull Request check-list

  • Do tests and lints pass with this change?

Everything passes except one standalone test: tests/test_commands.py::TestRedisCommands::test_psync

However, I ran the tests on the master branch of the repo and got the same result, so I assume that test failure is unrelated to my changes.

  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?

mharding-hpe#2

  • Is the new or changed code fully tested?

  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

N.A

  • Is there an example added to the examples folder (if applicable)?

N/A

Description of change

Opened to resolve issue #3700

Added type annotations to the deprecated_args decorator, to clarify that the type of callable will not be modified by anything inside the different functions (thus preserving its original signature). Without this, mypy interprets the type of redis.Redis() to be Any.

This issue was introduced between v6.0.0b2 and v6.0.0. So ideally this fix would be backported to the v6.0 and v6.1 branches, but I don't know the policy for that in this project.

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.

1 participant