mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
refactor: Update type annotations in sphinx.util.*
This commit is contained in:
parent
8576e97e34
commit
ecae46027a
@ -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)
|
||||
|
||||
|
@ -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',
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user