Conversation
There was a problem hiding this comment.
Pull request overview
This PR appears focused on addressing updated Ruff lint/type-checking expectations (and a few small refactors) across pytools, including typing-variance cleanup and targeted lint suppressions.
Changes:
- Updated typing TypeVar names to explicitly encode variance (e.g.,
T_co,R_co) and propagated through public type aliases/signatures. - Added/adjusted Ruff configuration and inline
noqasuppressions for intentionalexecusage and self-comparison patterns. - Minor cleanups/refactors in tests and small runtime code paths (e.g., simplifying returns, using
extendwith a generator).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
pytools/test/test_pytools.py |
Switches object-array imports to from pytools import obj_array. |
pytools/test/test_persistent_dict.py |
Refactors assertions to use loop values directly; adds a Ruff suppression for NaN self-compare. |
pytools/py_codegen.py |
Adds # noqa: S102 on intentional exec calls. |
pytools/prefork.py |
Simplifies wait() implementation. |
pytools/obj_array.py |
Renames T → T_co and updates many typing signatures/type aliases accordingly. |
pytools/datatable.py |
Uses extend with a generator in join() to build result rows. |
pytools/__init__.py |
Renames R → R_co, updates generics, and performs small return simplifications. |
pyproject.toml |
Expands Ruff ignore list and adds per-file ignores for S102. |
.basedpyright/baseline.json |
Updates baseline positions to reflect new typing changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alexfikl
reviewed
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #345