Pyright

Latest version: v1.1.390

Safety actively analyzes 685838 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 78 of 81

1.0.16

New Feature: Unused code blocks are now displayed as "grayed out" in VS Code.
New Feature: Use of "yield from" generates error for Python <3.3.
New Feature: Scanning of string literals now fully complies with Python spec, including support for all defined escape sequences.
New Feature: Added "reportInvalidStringEscapeSequence" config switch to control whether the analyzer reports errors or warnings for invalid escape sequences.
New Feature: Use of Protocol in a code file is now flagged as illegal for Python <3.7.
New Feature: An attempt to instantiate certain special classes defined in typing (Callable, Generic, etc.) now emits an error.
Fixed bug in import cycle detection logic that could result in slow analysis time and even an infinite loop.

1.0.15

New Feature: implemented proper type checking for assignments to variables with explicitly declared types.
New Feature: reportUntypedBaseClass enables reporting of base classes that are Unknown type and therefore defeat all type checking for derived types.
New Feature: reportOptionalContextManager enables reporting of Optional types used with "with" statements.
New Feature: reportOptionalOperand enables reporting of Optional types used within unary and binary statements where None is not otherwise permitted.
New Feature: more complete type checking for operand types for unary and binary statements.
New Feature: relaxed type checking of parameters to constructor of NamedTuple factory class if `<NTFactory>.__new__.__defaults__` is assigned a value at some point.
Bug Fix: Type[X] wasn't properly specialized in some cases.
Bug Fix: Literal byte strings (e.g. b'hello') are now properly typed as bytes rather than Unknown type.

1.0.14

New Feature: Added "reportOptionalIterable" config switch to allow reporting of Optional types used as iterables (e.g. in for statements).
New Feature: Added "reportImportCycles" config switch to report cycles in import graph.
New Feature: Added "reportPrivateUsage" config switch to report use of private variables and functions.
New Feature: Type checker now infers the types of list literals.
New Feature: Type checker now understands the unpack operator used within dictionaries, lists, and parameter lists.
New Feature: Type checker now validates types for slice operands.
New Feature: Type checker now understands `__getitem__`, `__setitem__`, and `__delitem__` magic operators and enforces their presence for subscripting.
Improved performance by restricting implicit imports when using "from X import Y" form of import statement.
Fixed some false positives in reporting of operator overrides for unary and binary operators.
Removed the assumption that "self" and "cls" are the first parameter names for instance and class methods.

1.0.13

New Feature: Added type checking for generator functions (i.e. functions that contain a 'yield' or 'yield from' statement).
New Feature: Added type checking for coroutine functions (i.e. async functions).
New Feature: Added type checking enforcement for iterators used in 'for' statements (__iter__ or __aiter__ overrides).
New Feature: Added type checking enforcement for 'with' statement (__enter__ or __aenter__ overrides).
New Feature: Added support for NoReturn return type.
New Feature: Replaced "--timing" command-line with "--stats", which now provides more stats than just timing.
Fixed bug where the use of a module as a type argument was not flagged as an error.
Improved type specialization logic for member accesses.

1.0.12

New Feature: Type checker now supports generators functions. If yield type isn't specified, the checker infers the type from yield clauses.
New Feature: Added support for type hints that use a combination of string and non-string tokens (e.g. Optional['Foo']).
New Feature: Added support for comment-based type hints for assignment statements, since these are used in some typeshed stub files.
New Feature: Added support for class decorators and added a configuration switch "reportUntypedClassDecorator" to allow these to be flagged by the type checker.
New Feature: Type checker now distinguishes between access, set, and delete operations when accessing members of an object and flags errors when that usage is not supported (e.g. writing to a property that has no defined setter).
Enhancement: Improved type checker's ability to track types within while and for loops.
Fixed bug with structural (protocol) type checking that generated false positives.
Deleted Python 2 typeshed fallback stub files since they are never used by Pyright. This reduced the package size by about 100K.

1.0.11

New Feature: Type checking support for dataclass, which was introduced in Python 3.7.
New Feature: Type checker now reports incorrect usage of ellipses in various cases.
Fixed 67: Modules are now treated as though they derive from object by the type checker.
Improved responsiveness of VS Code extension.
Improved error reporting for abstract class instantiation; abstract methods are now reported with their containing class.
Fixed 68: Silenced incorrect error for star expression usage (list expansion).
Fixed some edge cases relating to __new__ and __init__ validation.
Fixed 66: Bug caused an infinite loop in type checker.
Fixed automatic detection of python import paths for Python 3.x environments (contribution from zhangkaizhao)

Page 78 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.