Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated type annotations to match typeshed #77

Merged
merged 1 commit into from
Aug 14, 2023
Merged

Conversation

agronholm
Copy link
Owner

Fixes #76.

@jakkdl
Copy link
Contributor

jakkdl commented Aug 14, 2023

I downloaded stdlib/builtins.pyi and pruned+reformatted both it and exceptions/_exceptions.py to only have the type stubs remaining and ran a diff on them - here's the result:

only in typeshed

def __init__(
    self, __message: str, __exceptions: Sequence[_BaseExceptionT_co]
) -> None: ...
def __init__(
    self, __message: str, __exceptions: Sequence[_ExceptionT_co]
) -> None: ...

def __class_getitem__(cls, __item: Any) -> GenericAlias: ...

only in exceptiongroup/_exceptions.py

 def add_note(self, note: str) -> None: ...
def __str__(self) -> str: ...
def __repr__(self) -> str: ...

I suspect a couple of the above are intentional / does not matter.

there's otherwise no difference of signatures for functions which is great, assuming the types in typeshed are correct it means this PR is aok.

@agronholm agronholm merged commit 516ade1 into main Aug 14, 2023
10 checks passed
@agronholm agronholm deleted the update-annotations branch August 14, 2023 12:07
@agronholm
Copy link
Owner Author

Thanks for reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return types for derive shouldn't be Self
2 participants