mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-29 18:17:08 +07:00
PY-80427 Fixed IJ-MR-160807 GitOrigin-RevId: 966bdb2fd5e9a3a3ac9d06b4a7d65da3157160ba
20 lines
367 B
Python
20 lines
367 B
Python
from typing import dataclass_transform, TypeVar, Generic
|
|
|
|
T = TypeVar("T")
|
|
|
|
@dataclass_transform()
|
|
def deco(cls: T) -> T:
|
|
...
|
|
|
|
class MyDescriptor(Generic[T]):
|
|
def __set__(self, obj: object, value: T) -> None:
|
|
...
|
|
|
|
@deco
|
|
class MyClass:
|
|
id: MyDescriptor[int]
|
|
name: MyDescriptor[str]
|
|
year: MyDescriptor[int]
|
|
new: MyDescriptor[bool]
|
|
|
|
MyClass(<arg1>) |