summaryrefslogtreecommitdiff
path: root/logilab/common/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'logilab/common/__init__.py')
-rw-r--r--logilab/common/__init__.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/logilab/common/__init__.py b/logilab/common/__init__.py
index bf35711..0d7f183 100644
--- a/logilab/common/__init__.py
+++ b/logilab/common/__init__.py
@@ -29,13 +29,16 @@ __docformat__ = "restructuredtext en"
import sys
import types
import pkg_resources
+from typing import List, Sequence
__version__ = pkg_resources.get_distribution('logilab-common').version
# deprecated, but keep compatibility with pylint < 1.4.4
__pkginfo__ = types.ModuleType('__pkginfo__')
__pkginfo__.__package__ = __name__
-__pkginfo__.version = __version__
+# mypy output: Module has no attribute "version"
+# logilab's magic
+__pkginfo__.version = __version__ # type: ignore
sys.modules['logilab.common.__pkginfo__'] = __pkginfo__
STD_BLACKLIST = ('CVS', '.svn', '.hg', '.git', '.tox', 'debian', 'dist', 'build')
@@ -49,7 +52,7 @@ USE_MX_DATETIME = True
class attrdict(dict):
"""A dictionary for which keys are also accessible as attributes."""
- def __getattr__(self, attr):
+ def __getattr__(self, attr: str) -> str:
try:
return self[attr]
except KeyError:
@@ -170,7 +173,7 @@ def make_domains(lists):
# private stuff ################################################################
-def _handle_blacklist(blacklist, dirnames, filenames):
+def _handle_blacklist(blacklist: Sequence[str], dirnames: List[str], filenames: List[str]) -> None:
"""remove files/directories in the black list
dirnames/filenames are usually from os.walk