This commit is contained in:
Shaygan Hooshyari 2025-11-16 10:10:26 +01:00 committed by GitHub
commit f76697fd68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,20 @@
# `cls`
```toml
[environment]
python-version = "3.13"
```
## Methods
```py
from typing import Type, Self
class C:
@classmethod
def make_instance(cls: Type[Self]) -> Self:
return cls()
reveal_type(C.make_instance()) # revealed: C
reveal_type(C.make_instance) # revealed: bound method <class 'C'>.make_instance() -> C
```