Skip to content

Conversation

@KunalSachdev2005
Copy link

@KunalSachdev2005 KunalSachdev2005 commented Jan 24, 2026

What does this PR do ?

Modernizes type hints across the codebase by replacing deprecated typing module aliases with their recommended equivalents from collections.abc and built-in types.

Changelog

  • Replaced typing.Type, typing.List, typing.Dict, and typing.Tuple with built-in type, list, dict, and tuple
  • Replaced typing.Union and typing.Optional with | operator syntax
  • Moved Callable, Iterator, Iterable, Generator, Mapping, Set from typing to collections.abc
  • Replaced typing.Pattern and typing.Match with re.Pattern and re.Match
  • typing.NamedTuple, typing.TypeVar, typing.Generic, etc. usage remains in typing (not deprecated)

GitHub Actions CI

See the CI section in the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests? (NA - Refactoring existing code)
  • Did you add or update any necessary documentation? (Not needed)
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc) (No)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

Additional Information

  • Fixes Replace deprecated typehints #993
  • This is a pure refactoring PR with no functional changes
  • All type hints follow Python 3.9+ best practices as per PEP 585
  • Changes are backward compatible and maintain the same runtime behavior

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jan 24, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace deprecated typehints

1 participant