Whole file

erezsh/runtype

The author described this change as Fix tuple validation (Issue #6). It counts as a record because the check below fails on the code as it stood at 61a6f2f11 and passes on b251aff31, with nothing else changed between the two runs.

Fix saved2021-10-09
Sharing licenceMIT · LICENSE
Change size+4 0

What the code was meant to do, written into the code itself as a save note

Fix tuple validation (Issue #6)

The change

5151
5252
5353 class ProductType(ProductType, PythonType):
54+ """Used for Tuple
55+ """
5456 def validate_instance(self, obj, sampler=None):
57+ if not isinstance(obj, tuple):
58+ raise TypeMismatchError(f"Expected a tuple. Got {type(obj)}")
5559 if self.types and len(obj) != len(self.types):
5660 raise LengthMismatchError(self, obj)
5761 for type_, item in zip(self.types, obj):

The check that tells the two apart

failpass·tests/test_basic.py::TestIsa::test_basic

Check file tests/test_basic.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it61a6f2f11390de053eb75247ec809fe642a53282
Broken version dated2021-10-09
Moduleruntype.pytypes
Units changedProductType
Fingerprint19d21d8918bf657a
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in erezsh/runtype