File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -302,3 +302,7 @@ showcontent = true
302302pretty = true
303303disallow_untyped_defs = true
304304check_untyped_defs = true
305+
306+
307+ [tool .pyright ]
308+ include = [" typing-examples/baseline_examples.py" ]
Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: MIT
2+ # pyright: strict
23
34"""
45Baseline features that should be supported by all type checkers.
@@ -143,8 +144,8 @@ class OrderFlags:
143144
144145# field_transformer
145146def ft_hook2 (
146- cls : type , attribs : list [attrs .Attribute ]
147- ) -> list [attrs .Attribute ]:
147+ cls : type , attribs : list [attrs .Attribute [ Any ] ]
148+ ) -> list [attrs .Attribute [ Any ] ]:
148149 return attribs
149150
150151
@@ -155,9 +156,12 @@ class TransformedAttrs2:
155156
156157@attrs .define
157158class FactoryTest :
158- a : list [int ] = attrs .field (default = attrs .Factory (list ))
159- b : list [Any ] = attrs .field (default = attrs .Factory (list , False ))
159+ a : list [int ] = attrs .field (factory = list ) # pyright:ignore[reportUnknownVariableType]
160+ b : list [str ] = attrs .field ( # pyright:ignore[reportUnknownVariableType]
161+ default = attrs .Factory (list , takes_self = False ) # pyright:ignore[reportUnknownArgumentType]
162+ )
160163 c : list [int ] = attrs .field (default = attrs .Factory ((lambda s : s .a ), True ))
164+ d : list [int ] = attrs .Factory (list ) # pyright:ignore[reportUnknownVariableType]
161165
162166
163167attrs .asdict (FactoryTest ())
You can’t perform that action at this time.
0 commit comments