Skip to content

Refactor type hints in events.py to use Python 3.10+ syntax#3510

Merged
vfdev-5 merged 1 commit intopytorch:masterfrom
aaishwarymishra:refactor_engine/events
Feb 4, 2026
Merged

Refactor type hints in events.py to use Python 3.10+ syntax#3510
vfdev-5 merged 1 commit intopytorch:masterfrom
aaishwarymishra:refactor_engine/events

Conversation

@aaishwarymishra
Copy link
Contributor

This pull request updates type annotations in ignite/engine/events.py to use Python 3.10+ union syntax (X | Y) and built-in generics (e.g., list, dict) instead of the older typing module aliases. The changes improve code readability and modernize the codebase, but do not affect runtime behavior.

part of issue #3481

Fix type hinting in State class for event_to_attr and update __repr__ method to use __dict__

Fix formatting of comments in State class for clarity
@github-actions github-actions bot added the module: engine Engine module label Feb 4, 2026
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 @aaishwarymishra !

@vfdev-5 vfdev-5 added this pull request to the merge queue Feb 4, 2026
Merged via the queue into pytorch:master with commit 3252919 Feb 4, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: engine Engine module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants