| 44 | @pytest.mark.mypy_testing |
| 45 | def mypy_decorator_typing() -> None: |
| 46 | class T(HasTraits): |
| 47 | foo = Unicode("").tag(config=True) |
| 48 | |
| 49 | @default("foo") |
| 50 | def _default_foo(self) -> str: |
| 51 | return "hi" |
| 52 | |
| 53 | @observe("foo") |
| 54 | def _foo_observer(self, change: t.Any) -> bool: |
| 55 | return True |
| 56 | |
| 57 | @validate("foo") |
| 58 | def _foo_validate(self, commit: t.Any) -> bool: |
| 59 | return True |
| 60 | |
| 61 | t = T() |
| 62 | reveal_type(t.foo) # R: builtins.str |