Verifies python 3.7+ files use from __future__ import annotations
Project description
flake8-future-annotations
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
Built Distribution
Close
Hashes for flake8-future-annotations-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c313c1889be40039f7252d7c9bd3dd8934e60c76067408ec0e6a5580316670f |
|
MD5 | 965f08985bb1b23d744a872897f4ae50 |
|
BLAKE2b-256 | d3deea1313e3fcd83a42034867095096436343470be2eb77a6381f3e5d72505e |
Close
Hashes for flake8_future_annotations-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae8457ab1cca983d89dbcf103579c827c31c372a4aa46f64741b0390395c6ddf |
|
MD5 | 80338b88ed77422d431daed59761ea60 |
|
BLAKE2b-256 | ad0ac8080b04e71d4a036158dd3bfbefc9d06f48cd2090649581a4781d8a966d |