summaryrefslogtreecommitdiff
path: root/src/click/types.py
diff options
context:
space:
mode:
authorIwan Aucamp <aucampia@gmail.com>2021-02-01 00:43:14 +0100
committerDavid Lord <davidism@gmail.com>2021-02-15 15:41:56 -0800
commit5a77d69224936898e81010bb1c78fcb28e534318 (patch)
treea7c7828813539bd6b163f8e5ffd1031014bb04c0 /src/click/types.py
parentb8a33bf050ce41a398538d03dab6c8450ae76f28 (diff)
downloadclick-5a77d69224936898e81010bb1c78fcb28e534318.tar.gz
initial type checking configuration
add minimal annotations to pass checks
Diffstat (limited to 'src/click/types.py')
-rw-r--r--src/click/types.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/click/types.py b/src/click/types.py
index 626287d..6ca72c9 100644
--- a/src/click/types.py
+++ b/src/click/types.py
@@ -1,5 +1,6 @@
import os
import stat
+import typing as t
from datetime import datetime
from ._compat import _get_argv_encoding
@@ -33,7 +34,7 @@ class ParamType:
is_composite = False
#: the descriptive name of this type
- name = None
+ name: t.Optional[str] = None
#: if a list of this type is expected and the value is pulled from a
#: string environment variable, this is what splits it up. `None`
@@ -41,7 +42,7 @@ class ParamType:
#: whitespace splits them up. The exception are paths and files which
#: are split by ``os.path.pathsep`` by default (":" on Unix and ";" on
#: Windows).
- envvar_list_splitter = None
+ envvar_list_splitter: t.ClassVar[t.Optional[str]] = None
def to_info_dict(self):
"""Gather information that could be useful for a tool generating
@@ -345,7 +346,7 @@ class DateTime(ParamType):
class _NumberParamTypeBase(ParamType):
- _number_class = None
+ _number_class: t.ClassVar[t.Optional[t.Type]] = None
def convert(self, value, param, ctx):
try: