mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-07 06:01:00 +07:00
__post_init__ parameters have to match InitVars type not name GitOrigin-RevId: 0e1e4a9c3a50eee84cd724b5a3f8c5e894e90bdd
19 lines
525 B
Python
19 lines
525 B
Python
import dataclasses
|
|
|
|
@dataclasses.dataclass
|
|
class A:
|
|
a: int
|
|
b: dataclasses.InitVar[str]
|
|
c: dataclasses.InitVar[bytes]
|
|
|
|
def __post_init__<error descr="'__post_init__' should take all init-only variables in the same order as they are defined">(self)</error>:
|
|
pass
|
|
|
|
@dataclasses.dataclass
|
|
class B:
|
|
a: int
|
|
b: dataclasses.InitVar[str]
|
|
c: dataclasses.InitVar[bytes]
|
|
|
|
def __post_init__(self, c: <warning descr="Expected type 'str', got 'bytes' instead">bytes</warning>, b: bytes):
|
|
pass |