diff options
| author | Anthony Sottile <asottile@umich.edu> | 2019-01-28 16:21:00 +0000 |
|---|---|---|
| committer | Anthony Sottile <asottile@umich.edu> | 2019-01-28 16:21:00 +0000 |
| commit | d83fed0987939cb7257ba31d5065cb0256476614 (patch) | |
| tree | bcb3667a3590bb145c1137036d460fa31cb8f385 /src/flake8/utils.py | |
| parent | 1d167a7d36d8c9118a1446a11cf0d739c56ce7b5 (diff) | |
| parent | 3127d213f6dcc23e6f638d3e5c8cb9c10cac763a (diff) | |
| download | flake8-d83fed0987939cb7257ba31d5065cb0256476614.tar.gz | |
Merge branch 'latest_pyflakes' into 'master'
use latest pyflakes
See merge request pycqa/flake8!283
Diffstat (limited to 'src/flake8/utils.py')
| -rw-r--r-- | src/flake8/utils.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/flake8/utils.py b/src/flake8/utils.py index 0c97a39..502e1ca 100644 --- a/src/flake8/utils.py +++ b/src/flake8/utils.py @@ -8,6 +8,13 @@ import platform import re import sys import tokenize +from typing import Callable, Dict, Generator # noqa: F401 (until flake8 3.7) +from typing import List, Pattern, Sequence # noqa: F401 (until flake8 3,7) +from typing import Tuple, TYPE_CHECKING # noqa: F401 (until flake8 3.7) +from typing import Union # noqa: F401 (until flake8 3.7) + +if TYPE_CHECKING: + from flake8.plugins.manager import Plugin # noqa: F401 (until flake8 3.7) DIFF_HUNK_REGEXP = re.compile(r"^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$") COMMA_SEPARATED_LIST_RE = re.compile(r"[,\s]") @@ -15,7 +22,7 @@ LOCAL_PLUGIN_LIST_RE = re.compile(r"[,\t\n\r\f\v]") def parse_comma_separated_list(value, regexp=COMMA_SEPARATED_LIST_RE): - # type: (Union[Sequence[str], str]) -> List[str] + # type: (Union[Sequence[str], str], Pattern[str]) -> List[str] """Parse a comma-separated list. :param value: @@ -321,7 +328,7 @@ def _default_predicate(*args): def filenames_from(arg, predicate=None): - # type: (str, callable) -> Generator + # type: (str, Callable[[str], bool]) -> Generator """Generate filenames from an argument. :param str arg: @@ -382,7 +389,7 @@ def fnmatch(filename, patterns, default=True): def parameters_for(plugin): - # type: (flake8.plugins.manager.Plugin) -> Dict[str, bool] + # type: (Plugin) -> Dict[str, bool] """Return the parameters for the plugin. This will inspect the plugin and return either the function parameters |
