Commit 749f258
authored
In runtime python does not add fields that have `kw_only` marker:
-
https://github.com/python/cpython/blob/895d983b5c9716aaaab34d14d278084b9b6730d8/Lib/dataclasses.py#L1174-L1177
-
https://github.com/python/cpython/blob/895d983b5c9716aaaab34d14d278084b9b6730d8/Lib/dataclasses.py#L411-L417
See:
```python
>>> import dataclasses
>>> @dataclasses.dataclass(kw_only=True)
... class A:
... a: int
...
>>> print(A.__match_args__)
()
```
Closes #18863
1 parent e9fa89b commit 749f258
File tree
2 files changed
+19
-1
lines changed- mypy/plugins
- test-data/unit
2 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1847 | 1847 | | |
1848 | 1848 | | |
1849 | 1849 | | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
1850 | 1866 | | |
1851 | 1867 | | |
1852 | 1868 | | |
| |||
0 commit comments