Skip to content

style(core): modernize isinstance type checks to Python 3.10+ union syntax - #358

Open
ujjwalredd wants to merge 1 commit into
robocurve:mainfrom
ujjwalredd:fix/isinstance-type-checks
Open

style(core): modernize isinstance type checks to Python 3.10+ union syntax#358
ujjwalredd wants to merge 1 commit into
robocurve:mainfrom
ujjwalredd:fix/isinstance-type-checks

Conversation

@ujjwalredd

Copy link
Copy Markdown

Summary

Modernizes 25 isinstance(obj, (typeA, typeB)) type checks to Python 3.10+ union syntax (isinstance(obj, typeA | typeB)), satisfying Ruff rule UP038 across the core framework and first-party plugins.

Changes

  • Modernized isinstance calls across core modules (_html.py, _summarize.py, _video.py, cli.py, json_log.py) and plugins (inspect-robots-ros, inspect-robots-voice, inspect-robots-xpolicylab, inspect-robots-agent, inspect-robots-isaacsim).
  • Updated CHANGELOG.md under [Unreleased] -> Fixed.

Checklist

  • pre-commit install done; hooks pass
  • Tests added/updated
  • Coverage stays at 100% (pytest --cov)
  • ruff check . and ruff format --check . pass
  • mypy passes (strict)
  • CHANGELOG.md updated under "Unreleased"
  • Public API changes are reflected in inspect_robots.__all__ and the API-snapshot test
  • Core stays NumPy-only (new deps are optional extras, lazily imported)

Related

Closes #357

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.

[bug] Modernize isinstance tuple syntax to Python 3.10+ union types

1 participant