Skip to content

Commit

Permalink
clearer naming/comments
Browse files Browse the repository at this point in the history
  • Loading branch information
reaganjlee committed Oct 11, 2024
1 parent 080653b commit 2cef0f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions hypothesis-python/src/hypothesis/stateful.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ def do_draw(self, data):
if not bundle:
data.mark_invalid(f"Cannot draw from empty bundle {self.name!r}")

# We use both self.bundle and self.elements to make sure an index is used to safely pop
self.bundle = bundle
self.elements = range(len(bundle))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,11 @@ def do_draw(self, data):
return result

def get_element(self, i):
reference = self.elements[i]
value = self._transform(self.reference_to_value(reference))
element = self.elements[i]
value = self._transform(self.reference_to_value(element))
if is_identity_function(self.reference_to_value):
return value
return reference if value is not filter_not_satisfied else filter_not_satisfied
return element if value is not filter_not_satisfied else filter_not_satisfied

def do_filtered_draw(self, data):
# Set of indices that have been tried so far, so that we never test
Expand Down

0 comments on commit 2cef0f5

Please sign in to comment.