Skip to content

replace typing hints in ignite/metrics/regression/#3571

Open
suportly wants to merge 1 commit intopytorch:masterfrom
suportly:replace-typing-metrics-regression
Open

replace typing hints in ignite/metrics/regression/#3571
suportly wants to merge 1 commit intopytorch:masterfrom
suportly:replace-typing-metrics-regression

Conversation

@suportly
Copy link

Summary

  • Modernize type hints in all 18 files under ignite/metrics/regression/ to use Python 3.10+ syntax
  • Tuple[X, Y]tuple[X, Y]
  • Union[A, B]A | B
  • List[X]list[X]
  • Remove unused typing imports while keeping necessary ones (Callable, Any, cast)

Refs #3481

Test plan

  • All 436 regression metric tests pass (pytest tests/ignite/metrics/regression/ -v)
  • Verified no remaining old-style typing hints in ignite/metrics/regression/
  • Verified from ignite.metrics.regression import * works without errors

Modernize type hints in all 18 files under ignite/metrics/regression/ to
use Python 3.10+ syntax:
- Tuple[X, Y] -> tuple[X, Y]
- Union[A, B] -> A | B
- List[X] -> list[X]
- Remove unused typing imports

Refs pytorch#3481

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the module: metrics Metrics module label Feb 22, 2026
Copy link
Contributor

@omkar-334 omkar-334 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!
@vfdev-5 can you run the tests for this?

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Feb 25, 2026

This PR contains too much updated files. Please split into two PRs with <10 updated files.
Additionally, we should take into account this #3481 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: metrics Metrics module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants