Skip to content

Commit 244ad9e

Browse files
updated conditional_types docstring
1 parent 41e59ac commit 244ad9e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypy/checker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8176,10 +8176,12 @@ def conditional_types(
81768176
81778177
Returns a 2-tuple:
81788178
The first element is the proposed type, if the expression can be the proposed type.
8179+
(or default, if default is set and the expression is a subtype of the proposed type).
81798180
The second element is the type it would hold if it was not the proposed type, if any.
8181+
(or default, if default is set and the expression is not a subtype of the proposed type).
8182+
81808183
UninhabitedType means unreachable.
81818184
None means no new information can be inferred.
8182-
If default is set it is returned instead.
81838185
"""
81848186
if proposed_type_ranges:
81858187
if len(proposed_type_ranges) == 1:

0 commit comments

Comments
 (0)