Skip to content

Push pylance changes to pyright - #11396

Merged
Stella Huang (StellaHuang95) merged 2 commits into
microsoft:mainfrom
StellaHuang95:pull-pylance-20262101
Apr 21, 2026
Merged

Stella Huang (StellaHuang95) merged 2 commits into
microsoft:mainfrom
StellaHuang95:pull-pylance-20262101

Conversation

@StellaHuang95

Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

AutoSplit (https://github.com/Toufool/AutoSplit)
+     Argument corresponds to parameter "source" in function "compare_histograms" (reportUnknownArgumentType)
+   .../projects/AutoSplit/src/AutoSplitImage.py:231:13 - error: Argument type is unknown
+   .../projects/AutoSplit/src/AutoSplitImage.py:232:13 - error: Argument type is unknown
+     Argument corresponds to parameter "capture" in function "compare_histograms" (reportUnknownArgumentType)
-   .../projects/AutoSplit/src/compare.py:191:5 - error: Return type, "((source: Unknown, capture: Unknown, mask: Unknown | None = None) -> (float | Unknown)) | ((*_: object) -> float)", is partially unknown (reportUnknownParameterType)
+   .../projects/AutoSplit/src/compare.py:191:5 - error: Return type, "((source: Unknown, capture: Unknown, mask: Unknown | None = None) -> (float | Unknown)) | ((source: Unknown, capture: Unknown, mask: Unknown | None = None) -> Unknown) | ((*_: object) -> float)", is partially unknown (reportUnknownParameterType)
- 1086 errors, 2 warnings, 7 informations
+ 1088 errors, 2 warnings, 7 informations

sympy (https://github.com/sympy/sympy)
-   .../projects/sympy/sympy/core/relational.py:1295:22 - error: Argument of type "bool | GreaterThan | BooleanTrue | BooleanFalse | None" cannot be assigned to parameter "v" of type "bool | None" in function "fuzzy_not"
+   .../projects/sympy/sympy/core/relational.py:1295:22 - error: Argument of type "Any | bool | GreaterThan | BooleanTrue | BooleanFalse | None" cannot be assigned to parameter "v" of type "bool | None" in function "fuzzy_not"
-     Type "bool | GreaterThan | BooleanTrue | BooleanFalse | None" is not assignable to type "bool | None"
+     Type "Any | bool | GreaterThan | BooleanTrue | BooleanFalse | None" is not assignable to type "bool | None"
-   .../projects/sympy/sympy/core/relational.py:1303:22 - error: Argument of type "bool | GreaterThan | BooleanTrue | BooleanFalse | None" cannot be assigned to parameter "v" of type "bool | None" in function "fuzzy_not"
+   .../projects/sympy/sympy/core/relational.py:1303:22 - error: Argument of type "Any | bool | GreaterThan | BooleanTrue | BooleanFalse | None" cannot be assigned to parameter "v" of type "bool | None" in function "fuzzy_not"
-     Type "bool | GreaterThan | BooleanTrue | BooleanFalse | None" is not assignable to type "bool | None"
+     Type "Any | bool | GreaterThan | BooleanTrue | BooleanFalse | None" is not assignable to type "bool | None"
+   .../projects/sympy/sympy/integrals/manualintegrate.py:2378:19 - error: Argument of type "(AlternativeRule | DontKnowRule | tuple[Unknown, Unknown] | Unknown) -> (AlternativeRule | DontKnowRule | tuple[Unknown, Unknown] | Unknown)" cannot be assigned to parameter "rules" of type "(_T@do_one) -> _T@do_one" in function "do_one"
+     Type "(AlternativeRule | DontKnowRule | tuple[Unknown, Unknown] | Unknown) -> (AlternativeRule | DontKnowRule | tuple[Unknown, Unknown] | Unknown)" is not assignable to type "(RewriteRule) -> RewriteRule"
+       Function return type "AlternativeRule | DontKnowRule | tuple[Unknown, Unknown] | Unknown" is incompatible with type "RewriteRule"
+         Type "AlternativeRule | DontKnowRule | tuple[Unknown, Unknown] | Unknown" is not assignable to type "RewriteRule"
+           "AlternativeRule" is not assignable to "RewriteRule" (reportArgumentType)
+   .../projects/sympy/sympy/solvers/tests/test_solveset.py:445:30 - error: Cannot access attribute "limit_denominator" for class "NaN"
+     Attribute "limit_denominator" is unknown (reportAttributeAccessIssue)
+   .../projects/sympy/sympy/solvers/tests/test_solveset.py:445:30 - error: Cannot access attribute "limit_denominator" for class "ComplexInfinity"
+     Attribute "limit_denominator" is unknown (reportAttributeAccessIssue)
+   .../projects/sympy/sympy/stats/crv_types.py:2543:9 - error: Method "_cdf" overrides class "SingleContinuousDistribution" in an incompatible manner
+     Return type mismatch: base method returns type "None", override returns type "ComplexInfinity | NaN | Rational | Unknown"
+       Type "ComplexInfinity | NaN | Rational | Unknown" is not assignable to type "None"
+         "ComplexInfinity" is not assignable to "None" (reportIncompatibleMethodOverride)
+   .../projects/sympy/sympy/stats/crv_types.py:2722:9 - error: Method "_cdf" overrides class "SingleContinuousDistribution" in an incompatible manner
+     Return type mismatch: base method returns type "None", override returns type "Expr | NaN | ComplexInfinity | Rational | Unknown"
+       Type "Expr | NaN | ComplexInfinity | Rational | Unknown" is not assignable to type "None"
+         "Expr" is not assignable to "None" (reportIncompatibleMethodOverride)
+   .../projects/sympy/sympy/stats/frv_types.py:139:17 - error: Argument of type "NaN | ComplexInfinity | Rational | Unknown | Expr" cannot be assigned to parameter "value" of type "int" in function "__setitem__"
+     Type "NaN | ComplexInfinity | Rational | Unknown | Expr" is not assignable to type "int"
+       "Expr" is not assignable to "int" (reportArgumentType)
-   .../projects/sympy/sympy/stats/joint_rv_types.py:576:27 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
+   .../projects/sympy/sympy/stats/joint_rv_types.py:576:27 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
-     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "SupportsIndex"
+     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "SupportsIndex"
-   .../projects/sympy/sympy/stats/rv_interface.py:451:42 - error: Operator "-" not supported for types "Unknown | Basic | Any" and "Rational | Unknown"
+   .../projects/sympy/sympy/stats/rv_interface.py:451:42 - error: Operator "-" not supported for types "Unknown | Basic | Any" and "Rational | NaN | ComplexInfinity"
+     Operator "-" not supported for types "Basic" and "Rational"
+     Operator "-" not supported for types "Basic" and "NaN"
-     Operator "-" not supported for types "Basic" and "Rational" (reportOperatorIssue)
+     Operator "-" not supported for types "Basic" and "ComplexInfinity" (reportOperatorIssue)
-   .../projects/sympy/sympy/stats/tests/test_finite_rv.py:35:23 - error: Operator "/" not supported for types "Unknown | Any | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr | MatMul | Infinity | NegativeInfinity | Float | NotImplementedType | tuple[Unknown, ...] | int" and "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | ZeroMatrix | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0]"
+   .../projects/sympy/sympy/stats/tests/test_finite_rv.py:35:23 - error: Operator "/" not supported for types "Unknown | Any | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Expr | MatMul | tuple[Unknown, ...] | Infinity | NegativeInfinity | int" and "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | ZeroMatrix | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0]"
-   .../projects/sympy/sympy/stats/tests/test_finite_rv.py:247:19 - error: Argument of type "Rational | Unknown" cannot be assigned to parameter "p" of type "Half" in function "Coin"
+   .../projects/sympy/sympy/stats/tests/test_finite_rv.py:247:19 - error: Argument of type "Rational | NaN | ComplexInfinity" cannot be assigned to parameter "p" of type "Half" in function "Coin"
-     Type "Rational | Unknown" is not assignable to type "Half"
+     Type "Rational | NaN | ComplexInfinity" is not assignable to type "Half"
-       "Rational" is not assignable to "Half" (reportArgumentType)
+       "ComplexInfinity" is not assignable to "Half" (reportArgumentType)
-   .../projects/sympy/sympy/tensor/array/expressions/array_expressions.py:1717:32 - error: Type "tuple[Unknown, ...] | Tuple | Unknown" is not assignable to declared type "tuple[tuple[int, ...], ...]"
+   .../projects/sympy/sympy/tensor/array/expressions/array_expressions.py:1717:32 - error: Type "tuple[tuple[Unknown, ...] | Tuple | Unknown, ...] | Tuple | Unknown" is not assignable to declared type "tuple[tuple[int, ...], ...]"
-     Type "tuple[Unknown, ...] | Tuple | Unknown" is not assignable to type "tuple[tuple[int, ...], ...]"
+     Type "tuple[tuple[Unknown, ...] | Tuple | Unknown, ...] | Tuple | Unknown" is not assignable to type "tuple[tuple[int, ...], ...]"
-   .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:402:32 - error: Cannot access attribute "shape" for class "Infinity"
-     Attribute "shape" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:402:32 - error: Cannot access attribute "shape" for class "NegativeInfinity"
-     Attribute "shape" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:402:32 - error: Cannot access attribute "shape" for class "Float"
-     Attribute "shape" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:428:25 - error: Cannot access attribute "shape" for class "Infinity"
-     Attribute "shape" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:428:25 - error: Cannot access attribute "shape" for class "NegativeInfinity"
-     Attribute "shape" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:428:25 - error: Cannot access attribute "shape" for class "Float"
-     Attribute "shape" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/array/expressions/from_array_to_matrix.py:438:31 - error: Operator "*" not supported for types "Zero | ZeroArray | Unknown | ArrayContraction | Basic | PermuteDims | Any | Transpose | One | NegativeOne | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | NotImplementedType | Expr | MatMul" and "Zero | ZeroArray | Unknown | ArrayContraction | Basic | PermuteDims | Any | Transpose | MatrixExpr"

... (truncated 576 lines) ...

antidote (https://github.com/Finistere/antidote)
+   .../projects/antidote/tests/lib/lazy/test_lazy.py:517:39 - error: Argument type is partially unknown
+     Argument corresponds to parameter "value" in function "__init__"
+     Argument type is "dict[Unknown, Unknown]" (reportUnknownArgumentType)
+   .../projects/antidote/tests/lib/lazy/test_lazy.py:518:47 - error: Argument type is partially unknown
+     Argument corresponds to parameter "value" in function "__init__"
+     Argument type is "dict[Unknown, Unknown]" (reportUnknownArgumentType)
+   .../projects/antidote/tests/lib/lazy/test_lazy.py:519:54 - error: Argument type is partially unknown
+     Argument corresponds to parameter "value" in function "__init__"
+     Argument type is "dict[Unknown, Unknown]" (reportUnknownArgumentType)
+   .../projects/antidote/tests/lib/lazy/test_lazy.py:520:53 - error: Argument type is partially unknown
+     Argument corresponds to parameter "value" in function "__init__"
+     Argument type is "dict[Unknown, Unknown]" (reportUnknownArgumentType)
- 271 errors, 79 warnings, 0 informations
+ 275 errors, 79 warnings, 0 informations

core (https://github.com/home-assistant/core)
+   .../projects/core/homeassistant/components/alexa/__init__.py:112:29 - error: Type "dict[str, Any] | Unknown | Any | object" is not assignable to declared type "dict[str, Any] | None"
+     Type "dict[str, Any] | Unknown | Any | object" is not assignable to type "dict[str, Any] | None"
+       Type "object" is not assignable to type "dict[str, Any] | None"
+         "object" is not assignable to "dict[str, Any]"
+         "object" is not assignable to "None" (reportAssignmentType)
-   .../projects/core/homeassistant/components/alexa/__init__.py:113:44 - error: Argument of type "dict[str, Any] | Unknown | None" cannot be assigned to parameter "config" of type "ConfigType" in function "async_setup"
+   .../projects/core/homeassistant/components/alexa/__init__.py:113:44 - error: Argument of type "dict[str, Any] | None" cannot be assigned to parameter "config" of type "ConfigType" in function "async_setup"
-     Type "dict[str, Any] | Unknown | None" is not assignable to type "ConfigType"
+     Type "dict[str, Any] | None" is not assignable to type "ConfigType"
+   .../projects/core/homeassistant/components/analytics/analytics.py:323:23 - error: Type "Unknown | Any | object" is not assignable to declared type "dict[Unknown, Unknown]"
+     Type "Unknown | Any | object" is not assignable to type "dict[Unknown, Unknown]"
+       "object" is not assignable to "dict[Unknown, Unknown]" (reportAssignmentType)
+   .../projects/core/homeassistant/components/anthropic/config_flow.py:594:29 - error: Type "Unknown | Any | object" is not assignable to declared type "dict[str, str]"
+     Type "Unknown | Any | object" is not assignable to type "dict[str, str]"
+       "object" is not assignable to "dict[str, str]" (reportAssignmentType)
+   .../projects/core/homeassistant/components/application_credentials/__init__.py:93:18 - error: "__getitem__" method not defined on type "object" (reportIndexIssue)
+   .../projects/core/homeassistant/components/application_credentials/__init__.py:96:16 - error: Type "Unknown | Any | object" is not assignable to return type "dict[str, str]"
+     Type "Unknown | Any | object" is not assignable to type "dict[str, str]"
+       "object" is not assignable to "dict[str, str]" (reportReturnType)
+   .../projects/core/homeassistant/components/automation/config.py:158:29 - error: No overloads for "__init__" match the provided arguments (reportCallIssue)
+   .../projects/core/homeassistant/components/automation/config.py:158:46 - error: Argument of type "Unknown | Any | object" cannot be assigned to parameter "iterable" of type "Iterable[list[bytes]]" in function "__init__"
+     Type "Unknown | Any | object" is not assignable to type "Iterable[list[bytes]]"
+       "object" is incompatible with protocol "Iterable[list[bytes]]"
+         "__iter__" is not present (reportArgumentType)
+   .../projects/core/homeassistant/components/aws/__init__.py:128:16 - error: "__getitem__" method not defined on type "object" (reportIndexIssue)
+   .../projects/core/homeassistant/components/blueprint/importer.py:159:57 - error: Argument of type "Unknown | Any | object" cannot be assigned to parameter "topic" of type "dict[Unknown, Unknown]" in function "_extract_blueprint_from_community_topic"
+     Type "Unknown | Any | object" is not assignable to type "dict[Unknown, Unknown]"
+       "object" is not assignable to "dict[Unknown, Unknown]" (reportArgumentType)
+   .../projects/core/homeassistant/components/blueprint/models.py:314:37 - error: Type "Unknown | Any | object" is not assignable to declared type "dict[Unknown, Unknown]"
+     Type "Unknown | Any | object" is not assignable to type "dict[Unknown, Unknown]"
+       "object" is not assignable to "dict[Unknown, Unknown]" (reportAssignmentType)
+   .../projects/core/homeassistant/components/broadlink/remote.py:209:18 - error: Type "Unknown | Any | object" is not assignable to declared type "dict[str, Any]"
+     Type "Unknown | Any | object" is not assignable to type "dict[str, Any]"
+       "object" is not assignable to "dict[str, Any]" (reportAssignmentType)
+   .../projects/core/homeassistant/components/broadlink/remote.py:265:18 - error: Type "Unknown | Any | object" is not assignable to declared type "dict[str, Any]"
+     Type "Unknown | Any | object" is not assignable to type "dict[str, Any]"
+       "object" is not assignable to "dict[str, Any]" (reportAssignmentType)
+   .../projects/core/homeassistant/components/broadlink/remote.py:432:18 - error: Type "Unknown | Any | object" is not assignable to declared type "dict[str, Any]"
+     Type "Unknown | Any | object" is not assignable to type "dict[str, Any]"
+       "object" is not assignable to "dict[str, Any]" (reportAssignmentType)
+ .../projects/core/homeassistant/components/bthome/device_trigger.py
+   .../projects/core/homeassistant/components/bthome/device_trigger.py:91:14 - error: Type "Unknown | Any | object" is not assignable to declared type "ConfigType"
+     Type "Unknown | Any | object" is not assignable to type "ConfigType"
+       "object" is not assignable to "dict[str, Any]" (reportAssignmentType)
+   .../projects/core/homeassistant/components/bthome/device_trigger.py:139:9 - error: Argument of type "Unknown | Any | object" cannot be assigned to parameter "config" of type "ConfigType" in function "async_attach_trigger"
+     Type "Unknown | Any | object" is not assignable to type "ConfigType"
+       "object" is not assignable to "dict[str, Any]" (reportArgumentType)
-   .../projects/core/homeassistant/components/cloud/__init__.py:305:51 - error: Argument of type "str | Unknown | Any" cannot be assigned to parameter "alexa_user_config" of type "dict[str, Any]" in function "__init__"
+   .../projects/core/homeassistant/components/cloud/__init__.py:305:51 - error: Argument of type "str | Unknown | Any | object" cannot be assigned to parameter "alexa_user_config" of type "dict[str, Any]" in function "__init__"
-     Type "str | Unknown | Any" is not assignable to type "dict[str, Any]"
+     Type "str | Unknown | Any | object" is not assignable to type "dict[str, Any]"
-       "str" is not assignable to "dict[str, Any]" (reportArgumentType)
+       "object" is not assignable to "dict[str, Any]" (reportArgumentType)
-   .../projects/core/homeassistant/components/cloud/__init__.py:305:63 - error: Argument of type "str | Unknown | Any" cannot be assigned to parameter "google_user_config" of type "dict[str, Any]" in function "__init__"
+   .../projects/core/homeassistant/components/cloud/__init__.py:305:63 - error: Argument of type "str | Unknown | Any | object" cannot be assigned to parameter "google_user_config" of type "dict[str, Any]" in function "__init__"
-     Type "str | Unknown | Any" is not assignable to type "dict[str, Any]"
+     Type "str | Unknown | Any | object" is not assignable to type "dict[str, Any]"
-       "str" is not assignable to "dict[str, Any]" (reportArgumentType)
+       "object" is not assignable to "dict[str, Any]" (reportArgumentType)
+   .../projects/core/homeassistant/components/counter/__init__.py:152:23 - error: Type "Unknown | Any | object" is not assignable to declared type "dict[Unknown, Unknown]"
+     Type "Unknown | Any | object" is not assignable to type "dict[Unknown, Unknown]"
+       "object" is not assignable to "dict[Unknown, Unknown]" (reportAssignmentType)
+ .../projects/core/homeassistant/components/deconz/device_trigger.py
+   .../projects/core/homeassistant/components/deconz/device_trigger.py:704:14 - error: Type "Unknown | Any | object" is not assignable to declared type "ConfigType"
+     Type "Unknown | Any | object" is not assignable to type "ConfigType"
+       "object" is not assignable to "dict[str, Any]" (reportAssignmentType)
+   .../projects/core/homeassistant/components/deconz/device_trigger.py:754:15 - error: Argument of type "Unknown | Any | object" cannot be assigned to parameter "config" of type "ConfigType" in function "async_attach_trigger"
+     Type "Unknown | Any | object" is not assignable to type "ConfigType"
+       "object" is not assignable to "dict[str, Any]" (reportArgumentType)
+   .../projects/core/homeassistant/components/device_automation/__init__.py:346:14 - error: Type "Unknown | Any | object" is not assignable to declared type "ConfigType"
+     Type "Unknown | Any | object" is not assignable to type "ConfigType"
+       "object" is not assignable to "dict[str, Any]" (reportAssignmentType)
+ .../projects/core/homeassistant/components/device_automation/helpers.py
+   .../projects/core/homeassistant/components/device_automation/helpers.py:55:36 - error: Type "Unknown | Any | object" is not assignable to declared type "ConfigType"
+     Type "Unknown | Any | object" is not assignable to type "ConfigType"
+       "object" is not assignable to "dict[str, Any]" (reportAssignmentType)
+   .../projects/core/homeassistant/components/device_tracker/legacy.py:1074:13 - error: "__setitem__" method not defined on type "object" (reportIndexIssue)
+   .../projects/core/homeassistant/components/device_tracker/legacy.py:1079:27 - error: Arguments missing for parameters "consider_home", "track", "dev_id", "mac" (reportCallIssue)
+   .../projects/core/homeassistant/components/device_tracker/legacy.py:1079:42 - error: Argument expression after ** must be a mapping with a "str" key type (reportCallIssue)
+   .../projects/core/homeassistant/components/envisalink/alarm_control_panel.py:66:13 - error: "__getitem__" method not defined on type "object" (reportIndexIssue)
+   .../projects/core/homeassistant/components/envisalink/binary_sensor.py:51:13 - error: "__getitem__" method not defined on type "object" (reportIndexIssue)
+   .../projects/core/homeassistant/components/envisalink/binary_sensor.py:52:13 - error: "__getitem__" method not defined on type "object" (reportIndexIssue)

... (truncated 563 lines) ...

zulip (https://github.com/zulip/zulip)
-   .../projects/zulip/zerver/lib/events.py:2303:27 - error: Operator "-" not supported for type "list[Any] | Any" when expected type is "SupportsRichComparison" (reportOperatorIssue)
- 5284 errors, 360 warnings, 0 informations
+ 5283 errors, 360 warnings, 0 informations

spack (https://github.com/spack/spack)
+   .../projects/spack/lib/spack/spack/config.py:1778:32 - error: Expected 0 positional arguments (reportCallIssue)
+   .../projects/spack/lib/spack/spack/config.py:1778:40 - error: Cannot access attribute "validate" for class "__class__DefaultTypesDeprecatingMetaClass"
+     Attribute "validate" is unknown (reportAttributeAccessIssue)
+   .../projects/spack/lib/spack/spack/test/schema.py:170:32 - error: Expected 0 positional arguments (reportCallIssue)
+   .../projects/spack/lib/spack/spack/test/schema.py:174:7 - error: Cannot access attribute "validate" for class "__class__DefaultTypesDeprecatingMetaClass"
+     Attribute "validate" is unknown (reportAttributeAccessIssue)
+   .../projects/spack/lib/spack/spack/test/schema.py:179:11 - error: Cannot access attribute "validate" for class "__class__DefaultTypesDeprecatingMetaClass"
+     Attribute "validate" is unknown (reportAttributeAccessIssue)
+   .../projects/spack/lib/spack/spack/test/schema.py:184:32 - error: Expected 0 positional arguments (reportCallIssue)
+   .../projects/spack/lib/spack/spack/test/schema.py:188:11 - error: Cannot access attribute "validate" for class "__class__DefaultTypesDeprecatingMetaClass"
+     Attribute "validate" is unknown (reportAttributeAccessIssue)
+   .../projects/spack/lib/spack/spack/test/schema.py:197:32 - error: Expected 0 positional arguments (reportCallIssue)
+   .../projects/spack/lib/spack/spack/test/schema.py:202:11 - error: Cannot access attribute "validate" for class "__class__DefaultTypesDeprecatingMetaClass"
+     Attribute "validate" is unknown (reportAttributeAccessIssue)
+   .../projects/spack/lib/spack/spack/test/schema.py:208:32 - error: Expected 0 positional arguments (reportCallIssue)
+   .../projects/spack/lib/spack/spack/test/schema.py:211:7 - error: Cannot access attribute "validate" for class "__class__DefaultTypesDeprecatingMetaClass"
+     Attribute "validate" is unknown (reportAttributeAccessIssue)
- 1994 errors, 24 warnings, 0 informations
+ 2005 errors, 24 warnings, 0 informations

jax (https://github.com/google/jax)
+   .../projects/jax/jax/experimental/mosaic/gpu/examples/flash_attention.py:222:20 - error: Module is not callable (reportCallIssue)
+   .../projects/jax/jax/experimental/mosaic/gpu/examples/flash_attention.py:255:24 - error: Module is not callable (reportCallIssue)
+   .../projects/jax/jax/experimental/mosaic/gpu/examples/flash_attention.py:444:18 - error: Module is not callable (reportCallIssue)
+   .../projects/jax/jax/experimental/mosaic/gpu/examples/flash_attention.py:480:22 - error: Module is not callable (reportCallIssue)
+   .../projects/jax/jax/experimental/mosaic/gpu/examples/matmul.py:91:11 - error: Module is not callable (reportCallIssue)
-   .../projects/jax/jax/experimental/mosaic/gpu/examples/matmul.py:94:12 - error: Type "WGMMAAccumulator" is not assignable to return type "dict[str, WGMMAAccumulator]"
+   .../projects/jax/jax/experimental/mosaic/gpu/examples/matmul.py:94:12 - error: Type "Unknown | WGMMAAccumulator" is not assignable to return type "dict[str, WGMMAAccumulator]"
+     Type "Unknown | WGMMAAccumulator" is not assignable to type "dict[str, WGMMAAccumulator]"
-     "WGMMAAccumulator" is not assignable to "dict[str, WGMMAAccumulator]" (reportReturnType)
+       "WGMMAAccumulator" is not assignable to "dict[str, WGMMAAccumulator]" (reportReturnType)
- 3272 errors, 90 warnings, 0 informations
+ 3277 errors, 90 warnings, 0 informations

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@StellaHuang95
Stella Huang (StellaHuang95) merged commit 34c556b into microsoft:main Apr 21, 2026
16 checks passed
@StellaHuang95
Stella Huang (StellaHuang95) deleted the pull-pylance-20262101 branch April 21, 2026 16:59
Rich Chiodo (rchiodo) added a commit that referenced this pull request Jun 29, 2026
* Fix wildcard re-export treating class as module (#11481)

When a package re-exports (via 'from .sub import *') a name that is both an implicitly-imported submodule and a class/function/variable of the same name, the wildcard merge introduced in #11396 propagated only the submodule alias, dropping the real symbol. The re-exported name then resolved to a Module instead of the class.

_addWildcardImportedModuleAlias now only treats the wildcard re-export as a pure submodule re-export when the module alias is the imported symbol's effective (last) declaration; otherwise it falls through so a normal alias declaration is created that resolves to the winning symbol.

Fixes #11481

Co-authored-by: Copilot <[email protected]>

* Address review feedback: clarify binder guard rationale and lock in submodule re-export

- Explain why the guard intentionally uses the raw last declaration rather than getLastTypedDeclarationForSymbol (alias decls are untyped) and note the deliberate loss of submoduleFallback when the class wins.

- Drop inline issue links per repo convention (kept in PR/commit metadata).

- Add a companion fourslash assertion verifying a pure submodule re-export still resolves as a module with accessible members.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants