Skip to content

Modernize type hints in fbeta.py to Python 3.10+ syntax#3504

Merged
vfdev-5 merged 2 commits intomasterfrom
copilot/update-typing-hints-in-metrics-another-one
Feb 3, 2026
Merged

Modernize type hints in fbeta.py to Python 3.10+ syntax#3504
vfdev-5 merged 2 commits intomasterfrom
copilot/update-typing-hints-in-metrics-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 3, 2026

Migrates ignite/metrics/fbeta.py from legacy typing syntax to Python 3.10+ union operators per #3481.

Changes

  • Optional[X]X | None (function parameters and cast calls)
  • Union[str, torch.device]str | torch.device (in cast expressions)
  • Removed unused Optional and Union imports from typing module

Example

# Before
def Fbeta(
    precision: Optional[Precision] = None,
    device: Optional[Union[str, torch.device]] = None,
) -> MetricsLambda:
    ...

# After
def Fbeta(
    precision: Precision | None = None,
    device: str | torch.device | None = None,
) -> MetricsLambda:
    ...

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update typing hints in ignite metrics files Modernize type hints in fbeta.py to Python 3.10+ syntax Feb 3, 2026
Copilot AI requested a review from vfdev-5 February 3, 2026 08:52
@github-actions github-actions bot added the module: metrics Metrics module label Feb 3, 2026
@vfdev-5 vfdev-5 marked this pull request as ready for review February 3, 2026 08:59
@vfdev-5 vfdev-5 enabled auto-merge February 3, 2026 08:59
@vfdev-5 vfdev-5 added this pull request to the merge queue Feb 3, 2026
Merged via the queue into master with commit ae54b27 Feb 3, 2026
26 checks passed
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