Commit Graph

7012 Commits

Author SHA1 Message Date
Eric Traut
24d9890f36 Added sidebar link to locale documentation section. 2024-01-05 09:46:10 -07:00
Eric Traut
4afd9a4295 Added documentation for overriding the locale via env variables. 2024-01-05 09:44:27 -07:00
Eric Traut
930ff06e55
Improved evaluation logic for tuple slices. It now works in cases where the tuple includes unbounded entries or unpacked TypeVarTuples. This addresses #6906. (#6913) 2024-01-05 00:13:54 -07:00
Eric Traut
d0100aca93 Added support for constants for field names in NamedTuple call. This addresses #6878. 2024-01-04 20:41:11 -07:00
Eric Traut
1a701e4f7b
Removed support for Union[*Ts] and Union[*tuple[...]]. This functionality was included in an early draft of PEP 646 but was dropped in the final spec. The functionality can still be used in pyright if useExperimentalFeatures is set to true, but it will likely be removed entirely in the future. This addresses #6892. (#6912) 2024-01-04 20:17:05 -07:00
Eric Traut
7893909701
Fixed bug that resulted in incorrect type evaluation when a PEP-695 TypeVar is shadowed by an identifier of the same name within an inner scope. This addresses #6900. (#6911) 2024-01-04 17:29:42 -07:00
Eric Traut
839414cf51
Added code to report when the Concatentate special form is used in an illegal context. This addresses #6898. (#6910) 2024-01-04 16:13:37 -07:00
Eric Traut
34fb4bd71e
Fixed a bug that led to an incorrect type evaluation for an explicitly-specialized class parameterized with a ParamSpec. This addresses #6899. (#6909) 2024-01-04 15:42:32 -07:00
Eric Traut
677bb1306b Fixed false negative for a TypeVarTuple constructor call that includes value constraints. This addresses #6901. 2024-01-04 14:58:22 -07:00
Rich Chiodo
38b51fa735
Potential fix for config options crash (#6889)
* Potential fix for config options crash

* Fix problem with json stringifying a map
2024-01-03 10:15:56 -08:00
Eric Traut
bd137351ca Deleted incorrect comments from test case (a result of copy-and-paste from another test). No functional change. 2024-01-02 15:29:32 -07:00
Rich Chiodo
b914296752
Make sure web uris aren't read from disk (#6884) 2024-01-02 12:48:08 -08:00
Eric Traut
8f02660e2d Improved error reporting for incompatible overrides. 2024-01-01 14:39:17 -07:00
Eric Traut
ab2d3eb303 Improved error message for protocol classes that derive from non-protocol classes. 2024-01-01 14:32:21 -07:00
Eric Traut
a635a725a0 Updated documentation to refer to "value-constrained" TypeVars rather than just "constrained TypeVars", since all TypeVars are constrained in some manner. 2023-12-31 00:19:46 -07:00
Eric Traut
916ef9cdf5 Merge branch 'sortDiags' into main 2023-12-30 18:34:08 -07:00
Eric Traut
2342025312 Added a missing error condition for a non-method function that is marked @final. This addresses #6861. 2023-12-30 18:33:28 -07:00
Eric Traut
628c170d86 Fixed bug that led to false negative when a list expression was used within the first type argument of an Annotated type expression. This addresses #6863. 2023-12-30 18:24:14 -07:00
Eric Traut
68c1a71e45
Changed CLI to sort diagnostics by location within a file. (#6862) 2023-12-30 01:24:08 -07:00
Eric Traut
a807c07632 Changed CLI to sort diagnostics by location within a file. 2023-12-30 01:15:25 -07:00
Eric Traut
686e2f6cef Published 1.1.344 2023-12-29 17:57:47 -07:00
Eric Traut
8c178ce306
Fixed bug in code flow analysis that resulted in an incorrect type evaluation when a "NoReturn" call is made within a code block protected by an exception-suppressing context manager. This addresses #6850. (#6859) 2023-12-29 17:45:27 -07:00
Eric Traut
76b2e6966f
Improved overload overlap logic to detect partial overlaps when parameter types include unions that intersect. This addresses #6825. (#6856) 2023-12-29 15:28:51 -07:00
Eric Traut
e4dd42e2b1
Fixed a bug that leads to a false negative when validating type compatibility between two callables and the source has a position-only parameter corresponding to a non-position-only parameter in the dest. This addresses #6833. (#6854) 2023-12-29 13:51:40 -07:00
Eric Traut
064a5a50f3 Fixed a bug that results in a false negative when the TypeAliasType constructor is called with an expression that refers to a traditional TypeVar. This addresses #6835. 2023-12-29 12:53:25 -07:00
Eric Traut
47bc53fbcd Improved error reporting for with statement when __enter__ or __aenter__ is present but cannot be bound. This addresses #6849. 2023-12-29 11:20:06 -07:00
Eric Traut
e9e78ce7ea Fixed a bug that led to a false positive "not awaitable" error if the __await__ method return type was Unknown. This addresses #6844. 2023-12-29 03:43:57 -07:00
Eric Traut
b9748bdcd0
Fixed a bug that led to an incorrect type evaluation when explicitly specializing a generic class or type alias with a ParamSpec. This addresses #6826. (#6847) 2023-12-29 03:41:35 -07:00
Eric Traut
ec00c0031c
Improved detection of invalid type alias expressions for implicit (traditional) type aliases. This addresses #6827. (#6842) 2023-12-28 15:50:17 -07:00
Eric Traut
48e32d3d92
Added additional checks for invalid NewType calls. This addresses #6830, #6829 and #6828. (#6841) 2023-12-28 14:17:37 -07:00
Eric Traut
18bdc24464
Added LSP exemption for __post_init__ method. (#6840) 2023-12-28 12:02:30 -07:00
Eric Traut
2a06881083
Fixed a bug that resulted in a false negative when attempting to access valid attributes from a type alias created via a call to the TypeAliasType constructor. This addresses #6834. (#6839) 2023-12-28 11:52:41 -07:00
Eric Traut
2b3da713c3
Improved logic that determines whether the expression used for a type statement or a call to TypeAliasType is a valid type expression. This addresses #6836 and #6831. (#6838) 2023-12-28 10:53:31 -07:00
Eric Traut
e75b12c25f Fixed bug in parser that resulted in an incorrect syntax error when certain expression forms were used with the type statement to define a type alias. 2023-12-28 00:57:52 -07:00
Eric Traut
341f8a98aa Fixed bug that caused "go to definition" and semantic rename to not work for forward-declared symbols referenced in a "type" type alias definition. This addresses https://github.com/microsoft/pylance-release/issues/5304. 2023-12-27 23:59:24 -07:00
Eric Traut
b8609cd45e Fixed incorrect comment in test case. 2023-12-27 23:58:17 -07:00
Eric Traut
4fa9449953 Published 1.1.343 2023-12-25 21:16:01 -07:00
Eric Traut
d7e4edfbfd Added check for the use of a TypedDict class in an isinstance or issubclass call. These generate a runtime exception. This addresses #6809. 2023-12-25 19:34:53 -07:00
Eric Traut
c67f327cd2 Added detection of a call to TypedDict alternative syntax form that assigns the resulting class to a variable whose name doesn't match the name specified in the TypedDict call. This addresses #6812. 2023-12-25 15:49:26 -07:00
Eric Traut
e9f657c8b4 Added detection of invalid keyword arguments in TypedDict class definition when using the normal class syntax. This addresses #6813. 2023-12-25 15:10:15 -07:00
Eric Traut
4c1081d07d
Fixed a bug that leads to a false negative when Self is used within a class definition statement. PEP 637 explicitly rejects this usage of Self. This addresses #6805. (#6808)
Fixed a bug that leads to a false negative when `Self` is used within a metaclass. PEP 637 explicitly rejects this usage of `Self`. This addresses #6806.
2023-12-24 15:06:23 -07:00
Eric Traut
296ff19d18
Add error checking for illegal use of unary, binary, or ternary operators within a type annotation. This addresses #6800. (#6804) 2023-12-23 22:01:52 -07:00
Eric Traut
315b79b19d
Fixed a bug in the function type assignment logic that leads to a false positive under certain circumstances involving a ParamSpec in an overload with a callback that includes a positional-only parameter separator. This addresses #6796. (#6797) 2023-12-22 16:09:26 -07:00
Eric Traut
7c5b8ee3bb
Fixed bug that resulted in incorrect type evaluation of a variable within a loop under certain conditions. This addresses #6764. (#6793) 2023-12-21 23:56:18 -07:00
Erik De Bonte
25d2d4fb05
Return invalid path from getFilePath rather than asserting (#6790) 2023-12-21 13:14:29 -08:00
Eric Traut
27ff8c8dfb
Eliminated some unnecessary work when determining the effective type of a symbol that doesn't have a declared type. When evaluated in the context of a particular usage, it's unnecessary to evaluate any assignments within the same execution scope. (#6786) 2023-12-20 15:31:43 -07:00
Eric Traut
7d0f48a5fc Published 1.1.342 2023-12-20 01:15:37 -07:00
Eric Traut
3cd99078a9 Fixed a bug that leads to infinite recursion (stack overflow). This addresses #6783. 2023-12-19 12:57:34 -07:00
Eric Traut
ec0b9e63da
Increased internal limit of the number of overload signatures that can be captured by a ParamSpec from 64 to 1024. This addresses #6781. (#6784) 2023-12-19 12:56:00 -07:00
Eric Traut
d339a8e74d
Fixed a bug that led to false negative errors when doing protocol matching with a method that uses Self in its signature. This addresses #6760. (#6778) 2023-12-18 16:48:45 -07:00