hauntsaninja / useful_types

Useful types for Python
MIT License
99 stars 5 forks source link

Modify `SequenceNotStr.index` posargs separator #23

Closed haakonvt closed 7 months ago

haakonvt commented 7 months ago

I'm on thin ice here (so please advice!), but it seems pyright is on to something:

error: Argument of type "list[str]" cannot be assigned to parameter "name" of type "str | SequenceNotStr[str]" in function "delete"
    Type "list[str]" cannot be assigned to type "str | SequenceNotStr[str]"
      "list[str]" is incompatible with "str"
      "list[str]" is incompatible with protocol "SequenceNotStr[str]"
        "index" is an incompatible type
          Type "(value: str, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize, /) -> int" cannot be assigned to type "(value: Any, /, start: int = 0, stop: int = ...) -> int"
            Position-only parameter mismatch; parameter "start" is not position-only
            Position-only parameter mismatch; parameter "stop" is not position-only (reportArgumentType)
haakonvt commented 7 months ago

fyi: @hauntsaninja 🙏

hauntsaninja commented 7 months ago

Thanks for the PR! I should probably update the version of pyright we use in the tests to whichever version complains about this :-)

hauntsaninja commented 7 months ago

Released in 0.2.1