File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3288,21 +3288,6 @@ def f(x: int | bool | MISSING):
32883288 "# ,
32893289) ;
32903290
3291- testcase ! (
3292- sentinel_is_truthy,
3293- r#"
3294- from typing_extensions import Sentinel
3295- from typing import Literal, assert_type
3296-
3297- MISSING = Sentinel("MISSING")
3298- x: MISSING | None = MISSING
3299- if x:
3300- assert_type(x, MISSING)
3301- else:
3302- assert_type(x, None)
3303- "# ,
3304- ) ;
3305-
33063291testcase ! (
33073292 sentinel_narrow_with_type_param,
33083293 r#"
Original file line number Diff line number Diff line change @@ -234,3 +234,18 @@ MISSING = Sentinel("MISSING")
234234MISSING.__name__ # E: Object of class `Sentinel` has no attribute `__name__`
235235 "# ,
236236) ;
237+
238+ testcase ! (
239+ sentinel_is_truthy,
240+ r#"
241+ from typing_extensions import Sentinel
242+ from typing import Literal, assert_type
243+
244+ MISSING = Sentinel("MISSING")
245+ x: MISSING | None = MISSING
246+ if x:
247+ assert_type(x, MISSING)
248+ else:
249+ assert_type(x, None)
250+ "# ,
251+ ) ;
You can’t perform that action at this time.
0 commit comments