Skip to content

Use built-in types rather than typing aliases for type annotations where possible #891

@mdboom

Description

@mdboom

Is this a duplicate?

Area

General cuda-python

Is your feature request related to a problem? Please describe.

As of Python 3.9, it is no longer necessary to do this kind of thing:

from typing import List

def foo() -> List[int]:
    return [1, 2, 3]

You can instead do:

def foo() -> list[int]:
    return [1, 2, 3]

Describe the solution you'd like

We should remove these uses of typing.Dict, typing.List, typing.Tuple and typing.Set and replace with built-in types where possible.

This might be a good job for Copilot.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

P2Low priority - Nice to haveenhancementAny code-related improvementsgood first issueGood for newcomers

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions