Skip to content

Commit 4839630

Browse files
committed
update type hints
1 parent b8dd6e9 commit 4839630

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

hypothesis-python/src/hypothesis/internal/conjecture/provider_conformance.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ def build_intervals(intervals: list[int]) -> list[tuple[int, int]]:
4444
if len(intervals) % 2:
4545
intervals = intervals[:-1]
4646
intervals.sort()
47-
# help mypy infer tuple[int, ...] -> tuple[int, int]
48-
return list(batched(intervals, 2, strict=True)) # type: ignore
47+
return list(batched(intervals, 2, strict=True))
4948

5049

5150
def interval_lists(

hypothesis-python/src/hypothesis/internal/observability.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,15 @@ def remove_observability_callback(f: CallbackT, /) -> None:
298298
callbacks for this thread.
299299
"""
300300
if f in _callbacks_all_threads:
301-
_callbacks_all_threads.remove(cast(CallbackAllThreadsT, f))
301+
_callbacks_all_threads.remove(f)
302302

303303
thread_id = threading.get_ident()
304304
if thread_id not in _callbacks:
305305
return
306306

307307
callbacks = _callbacks[thread_id]
308308
if f in callbacks:
309-
callbacks.remove(cast(CallbackThreadT, f))
309+
callbacks.remove(f)
310310

311311
if not callbacks:
312312
del _callbacks[thread_id]

hypothesis-python/src/hypothesis/internal/reflection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def get_pretty_function_description(f: object) -> str:
272272
return pretty(f)
273273
if not hasattr(f, "__name__"):
274274
return repr(f)
275-
name = f.__name__ # type: ignore
275+
name = f.__name__
276276
if name == "<lambda>":
277277
return lambda_sources.lambda_description(f)
278278
elif isinstance(f, (types.MethodType, types.BuiltinMethodType)):
@@ -518,7 +518,7 @@ def is_identity_function(f: Callable) -> bool:
518518

519519
# We know that f accepts a single positional argument, now check that its
520520
# code object is simply "return first unbound argument".
521-
template = (lambda self, x: x) if bound_args else (lambda x: x) # type: ignore
521+
template = (lambda self, x: x) if bound_args else (lambda x: x)
522522
try:
523523
return code.co_code == template.__code__.co_code
524524
except AttributeError: # pragma: no cover # pypy only

0 commit comments

Comments
 (0)