diff options
| author | Dennis Fink | 2019-08-24 13:50:26 +0200 |
|---|---|---|
| committer | Dennis Fink | 2019-08-24 13:50:26 +0200 |
| commit | bf02259e40e32396179888ec7462fda0a23305e2 (patch) | |
| tree | 465f1a086d473ae2b14a03a95c19d09a522861e3 | |
| parent | 4ab040afae245e72868b18c0999f497dac37fc6e (diff) | |
| download | patternutils-bf02259e40e32396179888ec7462fda0a23305e2.tar.gz patternutils-bf02259e40e32396179888ec7462fda0a23305e2.zip | |
Added correct typing annotations to utils.edit
Diffstat (limited to '')
| -rw-r--r-- | patternutils/utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/patternutils/utils.py b/patternutils/utils.py index 0c514e3..e78a86b 100644 --- a/patternutils/utils.py +++ b/patternutils/utils.py @@ -2,13 +2,15 @@ import os import click +from typing import Dict + def max_procs() -> int: cpu_count = os.cpu_count() return 1 if cpu_count is None else cpu_count * 2 -def edit(data: dict) -> dict: +def edit(data: Dict[str, str]) -> Dict[str, str]: longest = len(max(data, key=len)) temporary = ['{}\t{}\n'.format(key.ljust(longest), value) for key, value in data.items()] |
