8000 Strict typing with pyright fails due to use of Unknown · Issue #295 · Belval/pdf2image · GitHub
[go: up one dir, main page]

Skip to content

Strict typing with pyright fails due to use of Unknown #295

@MaffooBristol

Description

@MaffooBristol

This is in multiple places, but the uses of types such as Dict cause PyRight with strictTypingMode=True to complain about the use of Unknowns

For example jpegopt from convert_to_path() defines its type as:

jpegopt: Dict = None,

But it should be somewhat stricter, as just:

jpegopt: Dict[str, Any] = None,

Equally, for size:

size: Union[Tuple, int] = None,

Would become:

size: Union[Tuple[Optional[int], Optional[int]], int] = None,

I think this should be a fairly simple change to make but wondering whether it's something worth making a PR for – if so I can do that and link it to this issue.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      2ABF
      0