Matches one specific object only (i.e. makes '==' behave like 'is').
| 339 | |
| 340 | |
| 341 | class SameAs(Also): |
| 342 | """Matches one specific object only (i.e. makes '==' behave like 'is').""" |
| 343 | |
| 344 | def __init__(self, pattern, obj): |
| 345 | super().__init__(pattern) |
| 346 | self.obj = obj |
| 347 | |
| 348 | def __repr__(self): |
| 349 | return f"<is {self.obj!r}>" |
| 350 | |
| 351 | def _also(self, value): |
| 352 | return self.obj is value |
| 353 | |
| 354 | |
| 355 | class Matching(Also): |
no outgoing calls
no test coverage detected
searching dependent graphs…