Skip to content

Conversation

@aveao
Copy link

@aveao aveao commented Dec 9, 2025

Pull Request check-list

  • Do tests and lints pass with this change?
    • locally tested, yes
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
    • Yes
  • Is the new or changed code fully tested?
    • Runs fine, and this is only typing changes
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
    • Unsure if I see any related documentation, the docstring was already correct.
  • Is there an example added to the examples folder (if applicable)?
    • Not applicable

Description of change

Fixes #252

start/end are type hinted as int only, whereas when bylex (or byscore) is set to True, the value is expected to be prepended with [ or (, as stated both in the function's docstring and redis docs.

This can only be done if start/end are passed as a string or as bytes.

Equivalent to redis/redis-py#3872

@aveao aveao force-pushed the fix/252-zrange-type-hinting branch 2 times, most recently from c23ab63 to 5d23440 Compare December 9, 2025 15:57
@aveao aveao force-pushed the fix/252-zrange-type-hinting branch from 5d23440 to 156322e Compare December 9, 2025 15:58
@mkmkme
Copy link
Collaborator

mkmkme commented Dec 9, 2025

Hey! Thanks for your PR. I'm currently working on the bigger change related to typing system in the repo. It's quite a mess at this point. My changes will make your changes obsolete. We can of course merge this one, but there won't be a lot of sense to keep it soon

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.

Type hinting of zrange command incompatible with bylex argument

2 participants