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

Better error messages on outdated context manager. #168

Merged
merged 4 commits into from
Jan 20, 2023

Conversation

Narsil
Copy link
Collaborator

@Narsil Narsil commented Jan 20, 2023

I think this PR might improve what was done in PR : #166

Link to idea: PyO3/pyo3#1205 (comment)

The problem is showcased in the test, were usage of f after the context manager would create a recursion error instead of a simple error.
By encapsulating everything within an inner class, we case rely on the type system to provide a correct error which is that the context manager is outdated.

@Narsil Narsil force-pushed the better_implem_of_drop branch from 9005fe1 to fced0a0 Compare January 20, 2023 10:06
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jan 20, 2023

The documentation is not available anymore as the PR was closed or merged.

@Narsil Narsil requested review from thomasw21 and McPatate January 20, 2023 10:12
bindings/python/src/lib.rs Show resolved Hide resolved
@Narsil Narsil merged commit a98326a into main Jan 20, 2023
@Narsil Narsil deleted the better_implem_of_drop branch January 20, 2023 14:05
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.

3 participants