Eric Traut
|
98fcba13dd
|
Added support for the X is C and X is not C type guard pattern (where C is a class). This addresses #5490. (#5544)
Co-authored-by: Eric Traut <erictr@microsoft.com>
|
2023-07-19 20:28:55 -07:00 |
|
Eric Traut
|
6a25a7bf0b
|
Removed the requirement that a TypedDict be marked @final for it to be considered for type narrowing as part of a S in D type guard pattern. This requirement wasn't sound because TypedDict is a structural type (i.e. a protocol), so @final doesn't have any real meaning.
|
2023-07-17 08:01:52 -07:00 |
|
Eric Traut
|
c767228a82
|
Improved documentation for "implied else" type narrowing.
|
2023-06-29 01:28:19 +02:00 |
|
Eric Traut
|
24b612fda2
|
Reverted overload change for now. It's causing breaks in the pandas-stubs library. More investigation is needed.
|
2023-06-06 17:53:24 -06:00 |
|
Eric Traut
|
746e03a49d
|
Modified overload matching algorithm to better match that of mypy. In particular, if overload matching is ambiguous due to an Any or Unknown anywhere within an argument type (even within type arguments) and the resulting filtered overloads return the same generic type but with different type arguments, the resulting type was previously the return type of the first filtered overload. It is now the common generic type with erased type arguments. This addresses https://github.com/microsoft/pyright/issues/5216.
|
2023-06-03 17:36:09 -06:00 |
|
Eric Traut
|
39cac72d99
|
Improved documentation for conditional types.
|
2023-04-05 15:50:00 -07:00 |
|
Eric Traut
|
08085479ef
|
Extended type narrowing for type guards of the form x[I] is B and x[I] is not B where x is a tuple and B is an enum literal.
|
2023-03-30 18:26:46 -07:00 |
|
Eric Traut
|
f1db88481f
|
Added support for type guards of the form x[I] is B and x[I] is not B where x is a tuple and B is a boolean literal True or False . This addresses part of https://github.com/microsoft/pyright/issues/4875.
|
2023-03-30 18:10:06 -07:00 |
|
Eric Traut
|
c83a95e62e
|
More improvements to documentation.
|
2023-03-07 16:38:22 -07:00 |
|