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

Enforce GC contract at compile time #531

Merged
merged 3 commits into from
Jul 15, 2019
Merged

Conversation

pganssle
Copy link
Member

PyGCProtocol must be implemented for anything registered as tracked by the garbage collector. This modifies the pyclass macro to enforce this at compile time.

@kngwyu
Copy link
Member

kngwyu commented Jul 14, 2019

Good catch, 👍 for this PR

Alexander-N added a commit to Alexander-N/pyo3 that referenced this pull request Jul 14, 2019
Implementations for these methods should always be provided. See PyO3#531
PyGCProtocol must be implemented for anything registered as tracked by
the garbage collector. This modifies the `pyclass` macro to enforce this
at compile time.
@pganssle pganssle changed the title WIP: Enforce GC contract at compile time Enforce GC contract at compile time Jul 14, 2019
@pganssle pganssle marked this pull request as ready for review July 14, 2019 16:00
@codecov
Copy link

codecov bot commented Jul 14, 2019

Codecov Report

Merging #531 into master will decrease coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #531      +/-   ##
==========================================
- Coverage   87.68%   87.56%   -0.12%     
==========================================
  Files          65       65              
  Lines        3443     3443              
==========================================
- Hits         3019     3015       -4     
- Misses        424      428       +4
Impacted Files Coverage Δ
src/instance.rs 96.66% <0%> (-1.34%) ⬇️
src/err.rs 61.11% <0%> (-1.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 670b41c...e633ae2. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jul 14, 2019

Codecov Report

Merging #531 into master will decrease coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #531      +/-   ##
==========================================
- Coverage   87.68%   87.56%   -0.12%     
==========================================
  Files          65       65              
  Lines        3443     3443              
==========================================
- Hits         3019     3015       -4     
- Misses        424      428       +4
Impacted Files Coverage Δ
src/instance.rs 96.66% <0%> (-1.34%) ⬇️
src/err.rs 61.11% <0%> (-1.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 670b41c...e633ae2. Read the comment docs.

Copy link
Member

@kngwyu kngwyu left a comment

Choose a reason for hiding this comment

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

Nice document 👍

@kngwyu
Copy link
Member

kngwyu commented Jul 15, 2019

Thanks!

@kngwyu kngwyu merged commit 29b0a02 into PyO3:master Jul 15, 2019
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