mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-18 11:41:21 +00:00
343 B
343 B
cls
[environment]
python-version = "3.13"
Methods
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