Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

used typing.TYPE_CHECKING instead of False #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions promise/async_.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Based on https://github.com/petkaantonov/bluebird/blob/master/src/promise.js
from collections import deque
from threading import local
from typing import TYPE_CHECKING

if False:
if TYPE_CHECKING:
from .promise import Promise
from typing import Any, Callable, Optional, Union # flake8: noqa
from typing import Any, Callable, Optional, Union


class Async(local):
Expand Down
3 changes: 2 additions & 1 deletion promise/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
from collections import Iterable
from functools import partial
from threading import local
from typing import TYPE_CHECKING

from .promise import Promise, async_instance, get_default_scheduler

if False:
if TYPE_CHECKING:
from typing import (
Any,
List,
Expand Down
4 changes: 3 additions & 1 deletion promise/iterate_promise.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# flake8: noqa
if False:
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from .promise import Promise
from typing import Iterator

Expand Down
4 changes: 2 additions & 2 deletions promise/promise.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
from .utils import deprecated, integer_types, string_types, text_type, binary_type, warn
from .promise_list import PromiseList
from .schedulers.immediate import ImmediateScheduler
from typing import TypeVar, Generic
from typing import TypeVar, Generic, TYPE_CHECKING

# from .schedulers.gevent import GeventScheduler
# from .schedulers.asyncio import AsyncioScheduler
# from .schedulers.thread import ThreadScheduler

if False:
if TYPE_CHECKING:
from typing import (
Type,
List,
Expand Down
5 changes: 2 additions & 3 deletions promise/promise_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
from collections.abc import Iterable
except ImportError:
from collections import Iterable
from typing import TYPE_CHECKING

if False:
if TYPE_CHECKING:
from .promise import Promise
from typing import (
Any,
Optional,
Tuple,
Union,
List,
Type,
Collection,
) # flake8: noqa
Expand Down