@@ -240,27 +240,27 @@ def run(self) -> Any:
240
240
self .bytes_read = blocks .endpoints [self .block_count ]
241
241
self .block (self .block_count )
242
242
self .block_count += 1
243
- self .__pop (False )
243
+ self .__pop (discarded = False )
244
244
elif record >= START_EXAMPLE_RECORD :
245
245
self .__push (record - START_EXAMPLE_RECORD )
246
246
else :
247
247
assert record in (
248
248
STOP_EXAMPLE_DISCARD_RECORD ,
249
249
STOP_EXAMPLE_NO_DISCARD_RECORD ,
250
250
)
251
- self .__pop (record == STOP_EXAMPLE_DISCARD_RECORD )
251
+ self .__pop (discarded = record == STOP_EXAMPLE_DISCARD_RECORD )
252
252
return self .finish ()
253
253
254
254
def __push (self , label_index : int ) -> None :
255
255
i = self .example_count
256
256
assert i < len (self .examples )
257
- self .start_example (i , label_index )
257
+ self .start_example (i , label_index = label_index )
258
258
self .example_count += 1
259
259
self .example_stack .append (i )
260
260
261
- def __pop (self , discarded : bool ) -> None :
261
+ def __pop (self , * , discarded : bool ) -> None :
262
262
i = self .example_stack .pop ()
263
- self .stop_example (i , discarded )
263
+ self .stop_example (i , discarded = discarded )
264
264
265
265
def begin (self ) -> None :
266
266
"""Called at the beginning of the run to initialise any
@@ -276,7 +276,7 @@ def block(self, i: int) -> None:
276
276
"""Called with each ``draw_bits`` call, with ``i`` the index of the
277
277
corresponding block in ``self.examples.blocks``"""
278
278
279
- def stop_example (self , i : int , discarded : bool ) -> None :
279
+ def stop_example (self , i : int , * , discarded : bool ) -> None :
280
280
"""Called at the end of each example, with ``i`` the
281
281
index of the example and ``discarded`` being ``True`` if ``stop_example``
282
282
was called with ``discard=True``."""
@@ -342,7 +342,7 @@ def start_example(self, label: int) -> None:
342
342
self .labels .append (label )
343
343
self .trail .append (START_EXAMPLE_RECORD + i )
344
344
345
- def stop_example (self , discard : bool ) -> None :
345
+ def stop_example (self , * , discard : bool ) -> None :
346
346
if discard :
347
347
self .trail .append (STOP_EXAMPLE_DISCARD_RECORD )
348
348
else :
@@ -382,7 +382,7 @@ def begin(self):
382
382
def start_example (self , i : int , label_index : int ) -> None :
383
383
self .starts [i ] = self .bytes_read
384
384
385
- def stop_example (self , i : int , discarded : bool ) -> None :
385
+ def stop_example (self , i : int , * , discarded : bool ) -> None :
386
386
self .ends [i ] = self .bytes_read
387
387
388
388
def finish (self ) -> Tuple [IntList , IntList ]:
@@ -407,7 +407,7 @@ def begin(self) -> None:
407
407
def finish (self ) -> FrozenSet [int ]:
408
408
return frozenset (self .result )
409
409
410
- def stop_example (self , i : int , discarded : bool ) -> None :
410
+ def stop_example (self , i : int , * , discarded : bool ) -> None :
411
411
if discarded :
412
412
self .result .add (i )
413
413
@@ -422,7 +422,7 @@ def block(self, i: int) -> None:
422
422
if not self .examples .blocks .trivial (i ):
423
423
self .nontrivial [self .example_stack [- 1 ]] = 1
424
424
425
- def stop_example (self , i : int , discarded : bool ) -> None :
425
+ def stop_example (self , i : int , * , discarded : bool ) -> None :
426
426
if self .nontrivial [i ]:
427
427
if self .example_stack :
428
428
self .nontrivial [self .example_stack [- 1 ]] = 1
@@ -435,7 +435,7 @@ def finish(self) -> FrozenSet[int]:
435
435
trivial : FrozenSet [int ] = calculated_example_property (_trivial )
436
436
437
437
class _parentage (ExampleProperty ):
438
- def stop_example (self , i : int , discarded : bool ) -> None :
438
+ def stop_example (self , i : int , * , discarded : bool ) -> None :
439
439
if i > 0 :
440
440
self .result [i ] = self .example_stack [- 1 ]
441
441
@@ -746,7 +746,7 @@ def conclude_test(
746
746
Note that this is called after ``freeze`` has completed.
747
747
"""
748
748
749
- def draw_bits (self , n_bits : int , forced : bool , value : int ) -> None :
749
+ def draw_bits (self , n_bits : int , * , forced : bool , value : int ) -> None :
750
750
"""Called when ``draw_bits`` is called on on the
751
751
observed ``ConjectureData``.
752
752
* ``n_bits`` is the number of bits drawn.
@@ -973,14 +973,14 @@ def start_example(self, label: int) -> None:
973
973
self .__example_record .start_example (label )
974
974
self .labels_for_structure_stack .append ({label })
975
975
976
- def stop_example (self , discard : bool = False ) -> None :
976
+ def stop_example (self , * , discard : bool = False ) -> None :
977
977
if self .frozen :
978
978
return
979
979
if discard :
980
980
self .has_discards = True
981
981
self .depth -= 1
982
982
assert self .depth >= - 1
983
- self .__example_record .stop_example (discard )
983
+ self .__example_record .stop_example (discard = discard )
984
984
985
985
labels_for_structure = self .labels_for_structure_stack .pop ()
986
986
@@ -1082,7 +1082,7 @@ def draw_bits(self, n: int, *, forced: Optional[int] = None) -> int:
1082
1082
buf = bytes (buf )
1083
1083
result = int_from_bytes (buf )
1084
1084
1085
- self .observer .draw_bits (n , forced is not None , result )
1085
+ self .observer .draw_bits (n , forced = forced is not None , value = result )
1086
1086
self .__example_record .draw_bits (n , forced )
1087
1087
1088
1088
initial = self .index
0 commit comments