diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2023-01-05 20:10:24 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2023-01-05 20:10:24 -0500 |
commit | 78444f4c06df6a634fa67dd99ee7c07b6b633d9e (patch) | |
tree | 4651930bc1ec5449e408c347b2d660522f8ac9e4 /coverage/misc.py | |
parent | d4339ee90c3146f370d572cbb1b9ab9907daafad (diff) | |
download | python-coveragepy-git-78444f4c06df6a634fa67dd99ee7c07b6b633d9e.tar.gz |
style: use good style for annotated defaults parameters
Diffstat (limited to 'coverage/misc.py')
-rw-r--r-- | coverage/misc.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/coverage/misc.py b/coverage/misc.py index c2041b47..e0658eb1 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -180,7 +180,7 @@ def ensure_dir_for_file(path: str) -> None: ensure_dir(os.path.dirname(path)) -def output_encoding(outfile: Optional[IO[str]]=None) -> str: +def output_encoding(outfile: Optional[IO[str]] = None) -> str: """Determine the encoding to use for output written to `outfile` or stdout.""" if outfile is None: outfile = sys.stdout @@ -318,7 +318,7 @@ def format_local_datetime(dt: datetime.datetime) -> str: return dt.astimezone().strftime('%Y-%m-%d %H:%M %z') -def import_local_file(modname: str, modfile: Optional[str]=None) -> ModuleType: +def import_local_file(modname: str, modfile: Optional[str] = None) -> ModuleType: """Import a local file as a module. Opens a file in the current directory named `modname`.py, imports it @@ -365,7 +365,7 @@ SortableItem = TypeVar("SortableItem", bound=Sequence[Any]) def human_sorted_items( items: Iterable[SortableItem], - reverse: bool=False, + reverse: bool = False, ) -> List[SortableItem]: """Sort (string, ...) items the way humans expect. @@ -377,7 +377,7 @@ def human_sorted_items( return sorted(items, key=lambda item: (_human_key(item[0]), *item[1:]), reverse=reverse) -def plural(n: int, thing: str="", things: str="") -> str: +def plural(n: int, thing: str = "", things: str = "") -> str: """Pluralize a word. If n is 1, return thing. Otherwise return things, or thing+s. |