Skip to content

Modernize type hints in engine.py to use Python 3.10+ syntax#3509

Merged
vfdev-5 merged 1 commit intopytorch:masterfrom
aaishwarymishra:engine.py_type_hints_refactor
Feb 3, 2026
Merged

Modernize type hints in engine.py to use Python 3.10+ syntax#3509
vfdev-5 merged 1 commit intopytorch:masterfrom
aaishwarymishra:engine.py_type_hints_refactor

Conversation

@aaishwarymishra
Copy link
Copy Markdown
Collaborator

This pull request modernizes the type annotations throughout the ignite/engine/engine.py file by replacing legacy typing types (such as Optional, Union, List, Tuple, and Dict) with Python 3.10+ syntax (using | for unions and built-in generics like list, tuple, and dict). These changes improve code readability and align the codebase with current Python best practices.

This pr is part of issue #3481

@github-actions github-actions bot added the module: engine Engine module label Feb 3, 2026
@vfdev-5 vfdev-5 added this pull request to the merge queue Feb 3, 2026
Copy link
Copy Markdown
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.

Merged via the queue into pytorch:master with commit e13786c Feb 3, 2026
24 checks passed
@aaishwarymishra aaishwarymishra deleted the engine.py_type_hints_refactor branch February 10, 2026 16:45
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