add mdtest

This commit is contained in:
Carl Meyer 2025-12-11 16:37:55 -08:00
parent 5d7914ae16
commit 060a6173dc
No known key found for this signature in database
GPG Key ID: 2D1FB7916A52E121
1 changed files with 15 additions and 0 deletions

View File

@ -141,3 +141,18 @@ class C:
# revealed: (*, kw_only=Unknown | ((*, kw_only=Unknown) -> Unknown)) -> Unknown
reveal_type(self.d)
```
## Self-referential implicit attributes
```py
class Cyclic:
def __init__(self, data: str | dict):
self.data = data
def update(self):
if isinstance(self.data, str):
self.data = {"url": self.data}
# revealed: Unknown | str | dict[Unknown, Unknown] | dict[Unknown | str, Unknown | str]
reveal_type(Cyclic("").data)
```