Skip to content

Fix importlib.util.source_hash return annotation #10686

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

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

cdce8p
Copy link
Contributor

@cdce8p cdce8p commented Sep 8, 2023

Return the hash of source_bytes as bytes. [...]
https://docs.python.org/3/library/importlib.html#importlib.util.source_hash

>>> from pathlib import Path
>>> from importlib.util import source_hash
>>> 
>>> p = Path("README.md")
>>> print(source_hash(p.read_bytes()))
b'\x14\x9a~P\x1b\x89\x9f$'

Originally added in #6557

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thank you!

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

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

@hauntsaninja hauntsaninja merged commit 0bc34fc into python:main Sep 8, 2023
@cdce8p cdce8p deleted the fix-source_hash branch September 8, 2023 23:16
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.

2 participants