Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2
Revisión | 0f9bda0619055a9a1e8c4e2b1172caae3a164958 (tree) |
---|---|
Tiempo | 2024-03-08 23:29:58 |
Autor | Albert Mietus < albert AT mietus DOT nl > |
Commiter | Albert Mietus < albert AT mietus DOT nl > |
Undo removal of ProtocolWrapper.getattr ; used in TestDoubles-aigr-sieve::test_1_sieve_protocols
@@ -68,12 +68,12 @@ | ||
68 | 68 | if self.name == "": |
69 | 69 | self.name = f"Wrapper for {self.based_on.name}({self.arguments})" ### |
70 | 70 | |
71 | -# GAM: When based_on is a Protocol, delegate to self.based_on isn;t needed. When move to generic wrappper, it is ? | |
72 | -# def __getattr__(self, name): ### XXX move to Wrapper Base? | |
73 | -# """delegate "everything" to `.`based_on``! | |
74 | -# Kind of inherit, but not to superclass (Protocol), but to the instance (a Protocol) that is wrapped""" | |
75 | -# | |
76 | -# return getattr(self.based_on, name) | |
71 | + | |
72 | + def __getattr__(self, name): ### XXX move to Wrapper Base? | |
73 | + """delegate "everything" to `.`based_on``! | |
74 | + Kind of inherit, but not to superclass (Protocol), but to the instance (a Protocol) that is wrapped""" | |
75 | + | |
76 | + return getattr(self.based_on, name) | |
77 | 77 | |
78 | 78 | |
79 | 79 | @dataclass # pragma: no mutate |