Skip to content

pyright errors in generated code #202

@KrisThielemans

Description

@KrisThielemans

I'm running pyright 1.1.397 on generated code from yardl init playground (or our own model) and get lots of errors regarding Annotated and a few others. A sample:

~/playground/python/playground/_binary.py
  ~/playground/python/playground/_binary.py:635:16 - error: Object of type "Annotated" is not callable (reportCallIssue)
  ~/playground/python/playground/_binary.py:659:16 - error: Object of type "Annotated" is not callable (reportCallIssue)
~/playground/python/playground/_dtypes.py
  ~/playground/python/playground/_dtypes.py:23:5 - error: Argument of type "Annotated" cannot be assigned to parameter "key" of type "type | GenericAlias" in function "__setitem__"
    Type "Annotated" is not assignable to type "type | GenericAlias"
      "Annotated" is not assignable to "type"
      "Annotated" is not assignable to "GenericAlias" (reportArgumentType)

<snip>

~/playground/python/playground/yardl_types.py
  ~/playground/python/playground/yardl_types.py:273:29 - error: Argument of type "void" cannot be assigned to parameter "iter1" of type "Iterable[_T1@__new__]" in function "__new__"
    "void" is incompatible with protocol "Iterable[_T1@__new__]"
      "__iter__" is not present (reportArgumentType)
  ~/playground/python/playground/yardl_types.py:273:32 - error: Argument of type "void" cannot be assigned to parameter "iter2" of type "Iterable[_T2@__new__]" in function "__new__"
    "void" is incompatible with protocol "Iterable[_T2@__new__]"
      "__iter__" is not present (reportArgumentType)
17 errors, 0 warnings, 0 informations 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions