Skip to content

Commit

Permalink
refactor: Use a custom class instead of object for sentinel instance
Browse files Browse the repository at this point in the history
It makes typing stricter, since types don't depend on a very generic `object` type
  • Loading branch information
dmitry.dygalo authored and Stranger6667 committed Jan 24, 2020
1 parent a51369e commit 6e76153
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/schemathesis/types.py
Expand Up @@ -13,7 +13,12 @@
Cookies = Dict[str, Any] # pragma: no mutate
FormData = Dict[str, Any] # pragma: no mutate


class NotSet:
pass


# A filter for endpoint / method
Filter = Union[str, List[str], Tuple[str], Set[str], object] # pragma: no mutate
Filter = Union[str, List[str], Tuple[str], Set[str], NotSet] # pragma: no mutate

Hook = Callable[[SearchStrategy], SearchStrategy]
4 changes: 2 additions & 2 deletions src/schemathesis/utils.py
Expand Up @@ -11,9 +11,9 @@
from werkzeug.wrappers import Response as BaseResponse
from werkzeug.wrappers.json import JSONMixin

from .types import Filter
from .types import Filter, NotSet

NOT_SET = object()
NOT_SET = NotSet()


def deprecated(func: Callable, message: str) -> Callable:
Expand Down

0 comments on commit 6e76153

Please sign in to comment.