diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-16 20:18:34 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-16 20:18:34 +0900 |
commit | 81964e036b08e182fa9d58c6330a4094083f9070 (patch) | |
tree | 2a7fac748704d7f43f034e0431a4319ce9bff329 | |
parent | be608ca2313fc08eb842f3dc19d0f5d2d8227d08 (diff) | |
parent | ecae46027a3e33cf75c2d1eaecaf6f602d149b23 (diff) | |
download | sphinx-git-81964e036b08e182fa9d58c6330a4094083f9070.tar.gz |
Merge pull request #7128 from tk0miya/refactor_type_annotation2
refactor: Update type annotations in sphinx.util.*
-rw-r--r-- | sphinx/util/__init__.py | 2 | ||||
-rw-r--r-- | sphinx/util/inspect.py | 2 | ||||
-rw-r--r-- | sphinx/util/pycompat.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index 954315b86..12ae051f1 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -649,7 +649,7 @@ class progress_message: def __call__(self, f: Callable) -> Callable: @functools.wraps(f) - def wrapper(*args, **kwargs): + def wrapper(*args: Any, **kwargs: Any) -> Any: with self: return f(*args, **kwargs) diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index 80cac97d9..60daf3754 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -51,7 +51,7 @@ memory_address_re = re.compile(r' at 0x[0-9a-f]{8,16}(?=>)', re.IGNORECASE) # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, # 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Python Software # Foundation; All Rights Reserved -def getargspec(func): +def getargspec(func: Callable) -> Any: """Like inspect.getfullargspec but supports bound methods, and wrapped methods.""" warnings.warn('sphinx.ext.inspect.getargspec() is deprecated', diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py index ba4f83a71..061bbcb6d 100644 --- a/sphinx/util/pycompat.py +++ b/sphinx/util/pycompat.py @@ -52,7 +52,7 @@ class UnicodeMixin: .. deprecated:: 2.0 """ - def __str__(self): + def __str__(self) -> str: warnings.warn('UnicodeMixin is deprecated', RemovedInSphinx40Warning, stacklevel=2) return self.__unicode__() # type: ignore |