Skip to content

Static typing: parser utility type hints should reflect primitive types support #8174

@catarinacps

Description

@catarinacps

Static type checker used

pyright/pylance

AWS Lambda function runtime

3.13

Powertools for AWS Lambda (Python) version

latest

Static type checker info

Method "parse" overrides class "BaseEnvelope" in an incompatible manner
  Parameter 3 type mismatch: base parameter is type "type[T@parse]", override parameter is type "type[Model@parse]"
  Return type mismatch: base method returns type "NotImplementedType", override returns type "list[Model@parse | None]"
    Type "T@parse" is not assignable to type "BaseModel"
      "object*" is not assignable to "BaseModel"
    "list[Model@parse | None]" is not assignable to "NotImplementedType"

Code snippet

This is identifiable by analyzing the library's source code itself.

Possible Solution

I've created a PR that tackles this: #8175.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triagePending triage from maintainerstypingStatic typing definition related issues (mypy, pyright, etc.)

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions