Skip to content

typehints and imports #627

Closed
Closed
@mattsb42-aws

Description

@mattsb42-aws

Just wanted to let y'all know that you can remove stuff like this now that your minimum supported Python version is 3.7.

try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
from typing import Dict, Iterable, List, Optional, Set, Text # noqa pylint: disable=unused-import
except ImportError: # pragma: no cover
# We only actually need these imports when running the mypy checks
pass

I put those in because the version of the typing library for specifically 3.5.0 and 3.5.1 only has a subset of the type definitions present for newer versions. Since the typehints are all in comments (another thing you can change now that you don't support 2.7 anymore), the imports were only necessary when running mypy, thus the except: pass rather than stubbing.

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