Merge pull request #4650 from tk0miya/use_typing.TYPE_CHECKING_in_master

Use typing.TYPE_CHECKING (in master)
This commit is contained in:
Takeshi KOMIYA 2018-02-19 23:43:30 +09:00 committed by GitHub
commit c95f538913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 31 additions and 42 deletions

View File

@ -24,6 +24,7 @@ from .deprecation import RemovedInSphinx20Warning
if False:
# For type annotation
# note: Don't use typing.TYPE_CHECK here (for py27 and py34).
from typing import Any # NOQA

View File

@ -10,13 +10,12 @@
"""
import warnings
from typing import TYPE_CHECKING
from sphinx.deprecation import RemovedInSphinx20Warning
from sphinx.ext.apidoc import main as _main
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA
from sphinx.application import Sphinx # NOQA

View File

@ -16,8 +16,7 @@ from docutils import nodes
from sphinx.util import logging
from sphinx.util.nodes import clean_astext
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any, Dict # NOQA
from sphinx.application import Sphinx # NOQA

View File

@ -24,14 +24,15 @@
:license: BSD, see LICENSE for details.
"""
from typing import TYPE_CHECKING
from docutils import nodes, utils
from six import iteritems
import sphinx
from sphinx.util.nodes import split_explicit_title
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any, Dict, List, Tuple # NOQA
from docutils.parsers.rst.states import Inliner # NOQA
from sphinx.application import Sphinx # NOQA

View File

@ -10,11 +10,11 @@
"""
import os
from typing import TYPE_CHECKING
import sphinx
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any, Dict # NOQA
from sphinx.application import Sphinx # NOQA
from sphinx.environment import BuildEnvironment # NOQA

View File

@ -10,6 +10,8 @@
:license: BSD, see LICENSE for details.
"""
from typing import TYPE_CHECKING
from docutils import nodes
import sphinx
@ -19,8 +21,7 @@ from sphinx.ext.mathbase import setup_math as mathbase_setup
from sphinx.locale import _
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any, Dict # NOQA
from sphinx.application import Sphinx # NOQA

View File

@ -11,6 +11,8 @@
:license: BSD, see LICENSE for details.
"""
from typing import TYPE_CHECKING
from docutils import nodes
import sphinx
@ -19,9 +21,7 @@ from sphinx.ext.mathbase import get_node_equation_number
from sphinx.ext.mathbase import setup_math as mathbase_setup
from sphinx.locale import _
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any, Dict # NOQA
from sphinx.application import Sphinx # NOQA

View File

@ -10,12 +10,12 @@
"""
import warnings
from typing import TYPE_CHECKING
from sphinx.cmd.quickstart import main as _main
from sphinx.deprecation import RemovedInSphinx20Warning
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any # NOQA

View File

@ -15,8 +15,7 @@ from sphinx.search import SearchLanguage, parse_stop_word
import snowballstemmer
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any
swedish_stopwords = parse_stop_word(u'''

View File

@ -10,11 +10,11 @@ import os
import shutil
import sys
from io import open
from typing import TYPE_CHECKING
from six import PY2, text_type
if False:
# For type annotation
if TYPE_CHECKING:
from typing import Any, Callable, IO, List # NOQA