Skip to main content

Verifies python 3.7+ files use from __future__ import annotations

Project description

flake8-future-annotations

Python 3.7+ GitHub license Downloads

Verifies python 3.7+ files use from __future__ import annotations if a type is used in the module that can be rewritten using PEP 563.

Pairs well with pyupgrade with the --py37-plus flag or higher, since pyupgrade only replaces type annotations with the PEP 563 rules if from __future__ import annotations is present.

For example:

from typing import List

def main() -> None:
    a_list: List[str] = []
    a_list.append("hello")

could be rewritten as:

from __future__ import annotations

def main() -> None:
    a_list: list[str] = []
    a_list.append("hello")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-future-annotations-0.0.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file flake8-future-annotations-0.0.3.tar.gz.

File metadata

  • Download URL: flake8-future-annotations-0.0.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.7.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.2

File hashes

Hashes for flake8-future-annotations-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8c313c1889be40039f7252d7c9bd3dd8934e60c76067408ec0e6a5580316670f
MD5 965f08985bb1b23d744a872897f4ae50
BLAKE2b-256 d3deea1313e3fcd83a42034867095096436343470be2eb77a6381f3e5d72505e

See more details on using hashes here.

File details

Details for the file flake8_future_annotations-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: flake8_future_annotations-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.7.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.2

File hashes

Hashes for flake8_future_annotations-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ae8457ab1cca983d89dbcf103579c827c31c372a4aa46f64741b0390395c6ddf
MD5 80338b88ed77422d431daed59761ea60
BLAKE2b-256 ad0ac8080b04e71d4a036158dd3bfbefc9d06f48cd2090649581a4781d8a966d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page