Skip to content

replace typing hints in ignite/handlers/tqdm_logger.py#3591

Open
roli-lpci wants to merge 4 commits intopytorch:masterfrom
roli-lpci:fix/typing-modernize
Open

replace typing hints in ignite/handlers/tqdm_logger.py#3591
roli-lpci wants to merge 4 commits intopytorch:masterfrom
roli-lpci:fix/typing-modernize

Conversation

@roli-lpci
Copy link

Refs #3481

Description: Replace old typing hints with Python 3.10+ syntax in ignite/handlers/tqdm_logger.py.

  • Union[A, B] -> A | B
  • Optional[A] -> A | None
  • List -> list
  • Added from __future__ import annotations
  • Removed unused typing imports (List, Optional, Union)

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the module: handlers Core Handlers module label Feb 25, 2026
roli-lpci and others added 2 commits February 25, 2026 04:39
ignite requires Python >=3.10, so `X | Y` union syntax
works natively without the future import.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roli-lpci
Copy link
Author

Thanks for the review! Removed the unnecessary __future__ import and the extra blank line.

"""TQDM logger."""
from collections import OrderedDict
from typing import Any, Callable, List, Optional, Union
from typing import Any, Callable
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see in different PRs we have either from collections.abc import Callable, Mapping or from typing import Callable, Mapping. Let's make the code consistent and use from collections.abc import Callable, Mapping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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:11
@vfdev-5 vfdev-5 dismissed omkar-334’s stale review February 26, 2026 22:11

Contributor addressed requested changes

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

Labels

module: handlers Core Handlers module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants