Skip to content

Commit

Permalink
Fix pyrig)t errors in jsonschema.exceptions
Browse files Browse the repository at this point in the history
pyright flagged Self being used without a
`cls: type[Self]` annotation on a classmethod. Fix with the
appropriate annotation.

It also notes the use of Container as an Any-Generic. Fix by making it
`Container[str]` as appropriate in this case.
  • Loading branch information
sirosen committed May 26, 2022
1 parent 6fc0d80 commit a966aee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stubs/jsonschema/jsonschema/exceptions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _Error(Exception):
parent: _Error | None = ...,
) -> None: ...
@classmethod
def create_from(cls, other: _Error) -> Self: ...
def create_from(cls: type[Self], other: _Error) -> Self: ...
@property
def absolute_path(self) -> Sequence[str]: ...
@property
Expand Down Expand Up @@ -78,7 +78,7 @@ class ErrorTree:
@property
def total_errors(self): ...

def by_relevance(weak: Container = ..., strong: Container = ...) -> RelevanceFuncType: ...
def by_relevance(weak: Container[str] = ..., strong: Container[str] = ...) -> RelevanceFuncType: ...

relevance: RelevanceFuncType

Expand Down

0 comments on commit a966aee

Please sign in to comment.