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

Add stubs for pyasn1 #9437

Merged
merged 7 commits into from Jan 6, 2023
Merged

Add stubs for pyasn1 #9437

merged 7 commits into from Jan 6, 2023

Conversation

Avasam
Copy link
Sponsor Collaborator

@Avasam Avasam commented Jan 1, 2023

For use with ldap3 and python-jose stubs 😃
Source: https://github.com/pyasn1/pyasn1/tree/db8f1a7930c6b5826357646746337dafc983f953/pyasn1

Ref: #9491

@github-actions

This comment has been minimized.

stubs/pyasn1/pyasn1/codec/ber/decoder.pyi Outdated Show resolved Hide resolved
stubs/pyasn1/pyasn1/codec/ber/decoder.pyi Show resolved Hide resolved
stubs/pyasn1/pyasn1/codec/ber/encoder.pyi Outdated Show resolved Hide resolved
stubs/pyasn1/pyasn1/codec/ber/encoder.pyi Outdated Show resolved Hide resolved
stubs/pyasn1/pyasn1/codec/cer/encoder.pyi Outdated Show resolved Hide resolved
stubs/pyasn1/pyasn1/type/univ.pyi Outdated Show resolved Hide resolved
stubs/pyasn1/pyasn1/type/univ.pyi Outdated Show resolved Hide resolved
stubs/pyasn1/pyasn1/type/useful.pyi Outdated Show resolved Hide resolved
stubs/pyasn1/pyasn1/type/useful.pyi Outdated Show resolved Hide resolved
stubs/pyasn1/pyasn1/type/useful.pyi Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

AlexWaygood commented Jan 6, 2023

It looks like you removed a lot of __eq__ and __ne__ methods in b26e252 -- could you possibly add them back?

In general, we don't include methods or attributes in a subclass if they have the same signature as the same method or attribute as the superclass. But __eq__ and __ne__ methods are a bit special. Whether or not __eq__ is overridden on a subclass has a big impact on mypy's very useful --strict-equality option, for example. (I don't know if pyright does similar analysis.) For example, you can see that my proposal to remove decimal.Decimal.__eq__ in #6877 (comment) would have resulted in some false positives in pandas due to mypy's --strict-equality check.

In general, we need to be a lot more careful with dunder methods when it comes to removing them just because they're redundant overrides. E.g. python/mypy#13800 was caused by removing a few __hash__ methods in #8465, and I'm not sure anybody's been able to figure out exactly why yet!

@Avasam
Copy link
Sponsor Collaborator Author

Avasam commented Jan 6, 2023

Oh 😯 No problem I'll add 'em back!

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood merged commit b5048a0 into python:main Jan 6, 2023
@Avasam Avasam deleted the pyasn1-stubs branch January 6, 2023 18:28
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.

None yet

2 participants