File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
- ## Version 1.2.1
3
+ ## Version 1.2.2
4
4
5
5
- refactor: make it play nicer with pyright's ` reportUnhashable `
6
6
- chore: update setup-uv version in github actions to v6 to support ` python-version ` parameter
Original file line number Diff line number Diff line change 14
14
15
15
_T = TypeVar ('_T' )
16
16
17
- # These values should be written explicitly in the dataclass for pyright to recognize
18
- # them.
19
- dataclass_decorator = (
20
- dataclass (frozen = True , eq = False , unsafe_hash = True , kw_only = True )
21
- if sys .version_info >= (3 , 10 )
22
- else dataclass (frozen = True , eq = False , unsafe_hash = True )
23
- )
24
-
25
17
26
18
@dataclass_transform (kw_only_default = True , frozen_default = True , eq_default = False )
27
19
def immutable (cls : type [_T ]) -> type [_T ]:
20
+ dataclass_decorator = dataclass (
21
+ frozen = True ,
22
+ eq = False ,
23
+ unsafe_hash = True ,
24
+ ** ({'kw_only' : True } if sys .version_info >= (3 , 10 ) else {}),
25
+ )
28
26
return dataclass_decorator (cls )
29
27
30
28
31
29
@dataclass_transform (kw_only_default = True , frozen_default = True )
32
- @dataclass_decorator
30
+ # These values should be written explicitly in the dataclass for pyright to recognize
31
+ # them.
32
+ @dataclass (
33
+ frozen = True ,
34
+ eq = False ,
35
+ unsafe_hash = True ,
36
+ ** ({'kw_only' : True } if sys .version_info >= (3 , 10 ) else {}),
37
+ )
33
38
class Immutable :
34
39
def __init_subclass__ (
35
40
cls : type [Immutable ],
You can’t perform that action at this time.
0 commit comments