Skip to content

Move weakref object type to obj module #636

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 2 commits into from
Mar 10, 2019

Conversation

BenLewis-Seequent
Copy link

Promote weakref to be a core type by moving it out of its stdlib module and into the obj module. This is required to implement weakref callbacks, which I will redo in a followup PR. This was originally implemented as part of the outdated #488 PR.

Also, I have migrated the weakref type to use the 'any' payload and new style functions.

I built this on top of #635, so I could use PyRef::new_with_type.

@OddCoincidence
Copy link
Contributor

@Skinny121 Is this ready now that #635 is merged? (It's still marked draft)

@OddCoincidence
Copy link
Contributor

It looks like this just has some irrefutable pattern errors since weakref was the second to last PyObjectPayload variant. I'll just fix these and merge this since I need these changes for the new object representation.

@OddCoincidence OddCoincidence marked this pull request as ready for review March 10, 2019 19:44
@OddCoincidence OddCoincidence merged commit 8143adc into RustPython:master Mar 10, 2019
@codecov-io
Copy link

Codecov Report

Merging #636 into master will decrease coverage by 0.04%.
The diff coverage is 69.76%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #636      +/-   ##
==========================================
- Coverage   41.02%   40.98%   -0.05%     
==========================================
  Files          77       78       +1     
  Lines       17558    17588      +30     
  Branches     4516     4507       -9     
==========================================
+ Hits         7204     7208       +4     
- Misses       8446     8480      +34     
+ Partials     1908     1900       -8
Impacted Files Coverage Δ
vm/src/stdlib/weakref.rs 12.12% <100%> (-55.63%) ⬇️
vm/src/stdlib/re.rs 38.39% <33.33%> (+0.89%) ⬆️
vm/src/stdlib/socket.rs 59% <66.66%> (+0.38%) ⬆️
vm/src/pyobject.rs 58.39% <70%> (ø) ⬆️
vm/src/obj/objweakref.rs 78.26% <78.26%> (ø)
vm/src/function.rs 63.79% <0%> (-3.45%) ⬇️

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 ded7acc...6024e3e. Read the comment docs.

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.

4 participants