Skip to content

Commit 4177526

Browse files
author
Ryan Soklaski
committed
Update InferType definition
1 parent db5ed42 commit 4177526

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

hypothesis-python/src/hypothesis/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from itertools import chain
2626
from random import Random
2727
from typing import (
28+
TYPE_CHECKING,
2829
Any,
2930
BinaryIO,
3031
Callable,
@@ -114,7 +115,8 @@
114115

115116
if sys.version_info >= (3, 10): # pragma: no cover
116117
from types import EllipsisType as InferType
117-
118+
elif TYPE_CHECKING:
119+
from builtins import ellipsis as InferType
118120
else:
119121
InferType = type(Ellipsis)
120122

hypothesis-python/src/hypothesis/extra/django/_impl.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import unittest
1313
from functools import partial
1414
from inspect import Parameter, signature
15-
from typing import Optional, Type, Union
15+
from typing import TYPE_CHECKING, Optional, Type, Union
1616

1717
from django import forms as df, test as dt
1818
from django.contrib.staticfiles import testing as dst
@@ -28,7 +28,8 @@
2828

2929
if sys.version_info >= (3, 10): # pragma: no cover
3030
from types import EllipsisType as InferType
31-
31+
elif TYPE_CHECKING:
32+
from builtins import ellipsis as InferType
3233
else:
3334
InferType = type(Ellipsis)
3435

hypothesis-python/src/hypothesis/extra/ghostwriter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
from string import ascii_lowercase
8484
from textwrap import dedent, indent
8585
from typing import (
86+
TYPE_CHECKING,
8687
Any,
8788
Callable,
8889
Dict,
@@ -119,7 +120,8 @@
119120

120121
if sys.version_info >= (3, 10): # pragma: no cover
121122
from types import EllipsisType as InferType
122-
123+
elif TYPE_CHECKING:
124+
from builtins import ellipsis as InferType
123125
else:
124126
InferType = type(Ellipsis)
125127

hypothesis-python/src/hypothesis/strategies/_internal/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109

110110
if sys.version_info >= (3, 10): # pragma: no cover
111111
from types import EllipsisType as InferType
112-
112+
elif typing.TYPE_CHECKING:
113+
from builtins import ellipsis as InferType
113114
else:
114115
InferType = type(Ellipsis)
115116

0 commit comments

Comments
 (0)