Commit Graph

2524 Commits

Author SHA1 Message Date
Eric Traut
a64d66212a Published 1.1.77 2020-10-05 09:07:40 -07:00
Eric Traut
50d0e7b507 Added escapes in docstring markdown converter for "<" and ">" characters so they are not interpreted as an HTML tag by the markdown renderer. 2020-10-05 00:29:39 -07:00
Eric Traut
6adf907e4e Split type evaluator and checker tests into three different files so they can run in parallel. This shaves about 35% off the time it takes to run unit tests. 2020-10-04 23:58:39 -07:00
Eric Traut
e0fcd6da43 Fixed bug that caused type narrowing for assignments not to be applied when the source of the assignment was a call to a constructor. Improved type narrowing for assignments when destination is declared with one or more "Any" type arguments. Improved bidirectional type inference for list and dict types when destination type is a union that contains one or more specialized list or dict types. Improved support for generic recursive type aliases. Improved bidirectional type inference for list and dict types when destination type is a wider protocol type (like Iterable, Mapping, Sequence, etc.). 2020-10-04 23:34:29 -07:00
Eric Traut
99ed73aef9 Conditionalized python path logging so it doesn't appear for CLI unless verbose mode is enabled. 2020-10-04 23:23:30 -07:00
Eric Traut
dbd5774f31 Fixed bug in hover provider where it incorrectly labeled variables as "type alias" if they are instantiated from a type alias. 2020-10-04 23:04:59 -07:00
Eric Traut
fc0708e1d5 Added small optimization for type assignment checks involving type variables. 2020-10-04 23:03:32 -07:00
Eric Traut
fcecaa7398 Changed type printing logic to include the name of a module for module types for clarity. Rather than 'Module', it now prints 'Module("<name>")'. This string is used in hover text and diagnostic messages. 2020-10-04 17:47:29 -07:00
Eric Traut
436bb77390 Cleaned up some test cases. 2020-10-04 17:32:55 -07:00
Eric Traut
56e0d61bd3 Replaced deprecated methods in tests. 2020-10-04 17:32:37 -07:00
Eric Traut
36b2be087b Added getAliasClass method in ClassType namespace. Made isTypeAliasPlaceholder a type guard. 2020-10-04 17:32:09 -07:00
Eric Traut
e14aa282ec Fixed handling of bidirectional type inference when source is an expression involving an "and" or "or" binary operator. 2020-10-04 17:24:17 -07:00
Eric Traut
970f047b4c Eliminated spurious "cannot instantiate abstract class" error when the value being instantiated is typed as Type[X]. Even though X is abstract, this shouldn't generate an error because Type[X] means "any subclass of X". 2020-10-03 16:08:47 -07:00
Eric Traut
1f71ee12f1 Improved handling of constrained type variables where one of the constraints is a narrower version of another. 2020-10-03 15:52:13 -07:00
Eric Traut
54c1798691 Fixed bug that caused an internal error (stack overflow) when analyzing types of symbols that mutually depend upon each other and are potentially (but turn out not to be) type aliases. 2020-10-03 15:03:31 -07:00
Eric Traut
2157bb8569 Fixed regression relating to bidirectional type inference used for constructor calls. 2020-10-03 09:46:43 -07:00
Eric Traut
3a90e262e1 Simplified and improved populateTypeVarMapBasedOnExpectedType logic. 2020-10-03 09:32:36 -07:00
Eric Traut
4fb50e8011 Fixed spurious "variable is unbound" error when symbol was used in a compound conditional expression where the first part of the expression was statically determined to short-circuit the evaluation (e.g. if False and name:). 2020-10-03 01:13:10 -07:00
Eric Traut
3158a22b58 Fixed bug where float and complex values were being inferred as Literal types when PEP 586 clearly states that complex and float values are not supported for Literal. 2020-10-03 00:19:39 -07:00
Eric Traut
57175e8d3a Did another editing pass on the typed library documentation for readability and consistency. 2020-10-02 23:56:37 -07:00
Eric Traut
5cb41a9a6c Published 1.1.76 2020-10-02 18:15:34 -07:00
Eric Traut
db11ff5791 Added diagnostic check for static and class methods used for property getters, setters and deleters. 2020-10-02 18:13:55 -07:00
Eric Traut
af01be3244 Fixed documentation for building pyright. 2020-10-02 11:00:26 -07:00
Eric Traut
b2882fd6be Added support for the __all__ += <module>.__all__ idiom for mutating the __all__ value. This idiom is used by numpy. 2020-10-02 10:55:24 -07:00
Eric Traut
f0a231d7fc Fixed bug that caused symbols referenced by __all__ not to be marked as accessed in some cases. 2020-10-01 13:19:45 -07:00
Eric Traut
f7f5c1f8e7 Added support for __all__ assignments that include a type annotation. 2020-10-01 13:19:18 -07:00
Eric Traut
01c39df123 Improved handling of bidirectional type inference when RHS of assignment is a constructor. More changes to come on this front. 2020-09-30 18:15:28 -07:00
Eric Traut
9565833cc8 Added checks in type validator for metaclasses. 2020-09-30 18:15:28 -07:00
Eric Traut
7979c5d177 Added optimizations in type validator to avoid checking built-in classes. 2020-09-30 18:15:28 -07:00
Jake Bailey
a062092189
Fix paths when unset, fix tmpdir, other visual tweaks (#1074) 2020-09-30 12:41:59 -07:00
Eric Traut
98a28e450f Fixed bug where Enum constructor was not handling some variations of parameter types. 2020-09-29 15:54:12 -07:00
Eric Traut
05cdaf9344 Added missing section on type aliases within typed library documentation. 2020-09-29 15:16:48 -07:00
Eric Traut
67e94f4c8a Fixed markdown rendering issue in docs. 2020-09-29 15:04:51 -07:00
Eric Traut
1cb2a3a950 Added detailed documentation for the "--verifytypes" option. 2020-09-29 15:03:14 -07:00
Eric Traut
9c724205a5 Improved type verification report. 2020-09-29 00:16:24 -07:00
Eric Traut
01f41cb081 Fixed spurious error when "Literal" was used with a dynamic type argument in a place where a type annotation wasn't expected. 2020-09-28 18:32:05 -07:00
Eric Traut
9cb9f7e3dd Published 1.1.75 2020-09-28 16:37:01 -07:00
Eric Traut
11902f6dc0 Added support for __all__.append() idiom. 2020-09-28 16:25:47 -07:00
Eric Traut
bf3af4e1aa Added limiter for list type inference to clip the number of unique subtypes and avoid poor performance in some cases. 2020-09-28 16:13:12 -07:00
Eric Traut
04d35e9ce4 Fixed logic bug in dunder all processing for py.typed files. 2020-09-28 15:59:52 -07:00
Eric Traut
dc5cd387fc Implemented new "verifytypes" command-line option that analyzes a py.typed package and reports missing or partially-unknown types. 2020-09-28 14:49:32 -07:00
Eric Traut
bc298518e7 Implemented new rules for reexports within a py.typed module. ".py" files now follow PEP 484 rules with an override based on __all__. 2020-09-28 14:48:39 -07:00
Eric Traut
5ca499b112 Added support for additional idioms for __all__ manipulation, including __all__.extend() and __all__.remove(). The "extend" form also supports merging of __all__ lists from submodules. 2020-09-28 14:45:00 -07:00
Eric Traut
b6cd5eedae Fixed missing JSON field in command-line documentation. 2020-09-28 14:34:29 -07:00
Eric Traut
ee40041a88 Fixed bug in existing fourslash test. 2020-09-28 14:30:44 -07:00
Eric Traut
97f0a8946b Fixed bug in type inference for generator types. It was not properly adding the three type arguments for Generator in the inferred return type. 2020-09-28 10:12:45 -07:00
Eric Traut
a42d075b90 Improved handling of bidirectional type inference for constructor calls on generic types. In particular, the new logic better handles the case where the expected type is a union. 2020-09-28 09:17:32 -07:00
Eric Traut
9a991dc8d3 Fixed bug in callable type narrowing logic where the union of the type includes None. 2020-09-28 07:26:49 -07:00
Eric Traut
8c01e0d652 Cleaned up main CLI logic in prep for new type validation command. 2020-09-27 22:30:58 -07:00
Eric Traut
dd12062cbd Added getTotalDuration accessor in timing module. 2020-09-27 22:26:19 -07:00