Skip to content

Replace typing module hints with modern syntax in metrics/nlp#3599

Open
Manimaran-tech wants to merge 5 commits intopytorch:masterfrom
Manimaran-tech:fix/typing-metrics-nlp
Open

Replace typing module hints with modern syntax in metrics/nlp#3599
Manimaran-tech wants to merge 5 commits intopytorch:masterfrom
Manimaran-tech:fix/typing-metrics-nlp

Conversation

@Manimaran-tech
Copy link
Contributor

Description

Modernize type hints in ignite/metrics/nlp submodule by replacing typing module imports with Python 3.10+ built-in syntax.

Files changed:

  • ignite/metrics/nlp/bleu.py
  • ignite/metrics/nlp/rouge.py
  • ignite/metrics/nlp/utils.py

Related to #3591

@github-actions github-actions bot added the module: metrics Metrics module label Feb 26, 2026
def __init__(
self,
variants: Optional[Sequence[Union[str, int]]] = None,
variants: Optional[Sequence[str | int]] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Replace Optional[A] -> A | None

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Thanks!

@vfdev-5 vfdev-5 enabled auto-merge February 26, 2026 22:05
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.

2 participants