Skip to content

Conversation

G26karthik
Copy link
Contributor

This PR adds strict=True to all zip() calls in the pandas/_config/ directory to enforce Ruff rule B905.

Changes made:

  • Added strict=True to zip() call in set_option() function (line 274)
  • Added strict=True to zip() call in option_context() function (line 505)

Both functions use args[::2] and args[1::2] which are guaranteed to have equal length since the code validates that len(args) % 2 == 0 before the zip operations.

Closes #62434 for the pandas/_config/ directory.

Testing:

  • Syntax validation passed
  • No functional changes - both zip operations already assume equal-length iterables

Note: This is part of a larger effort to enforce strict zip usage across the pandas codebase.

Added strict=True to zip() calls in config.py to ensure equal length
iterables. This enforces Ruff rule B905 for the _config directory.
@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Oct 5, 2025
@mroeschke mroeschke added this to the 3.0 milestone Oct 5, 2025
@mroeschke mroeschke merged commit 99b32e2 into pandas-dev:main Oct 5, 2025
46 checks passed
@mroeschke
Copy link
Member

Thanks @G26karthik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

STY: Enforce Ruff rule B905, zip-without-explicit-strict
2 participants