Skip to content

Suggestion to always do import typing as t #1885

@jamilraichouni

Description

@jamilraichouni

Hi,

To avoid to have to maintain unnecessary long import lists like this:

from typing import Any, Callable, Coroutine, Dict, Iterable, List, Optional, Sequence, Tuple, Type, Union, cast

I suggest that you always do

import typing as t

and then refer to types via t.(...) like t.Optional etc. which is a nice trick.

All best,
Jamil

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions