| 163 | |
| 164 | def matches(self, value: Any) -> bool: |
| 165 | """Return True if ``value`` is a plausible Python value for this type. |
| 166 | |
| 167 | The runtime half of the unified interpretation: a structural predicate |
| 168 | used to validate arguments before marshalling. Scalars and containers |
| 169 | are checked precisely; ``named`` types are checked by identity when the |
| 170 | value is a Lean inductive value and accepted leniently otherwise (the |
| 171 | marshaller also accepts tuple/constructor spellings).""" |
| 172 | k = self.kind |
| 173 | if k == "unit": |
| 174 | return value is None |