Skip to content

Relocate PyObject_Generic* into object protocol #3662

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 3 commits into from
Apr 26, 2022

Conversation

Snowapril
Copy link
Contributor

This revision does the below things.

  • Relocate generic_setattr from builtins::object into protocol::object
  • Relocate generic_getattr, generic_getattr_opt from vm into object protocol
  • Remove duplicate generic_getattr in builtins::object

ref #3244
https://docs.python.org/3/c-api/object.html

As generic_setattr is included in object protocol, it seems more
appropriate to relocate.

Signed-off-by: snowapril <sinjihng@gmail.com>
@Snowapril Snowapril marked this pull request as draft April 26, 2022 11:43
According to cpython docs, generic_getattr/opt is object protocol.
It is more appropriate to locate in protocol/object.rs than vm

Signed-off-by: snowapril <sinjihng@gmail.com>
Signed-off-by: snowapril <sinjihng@gmail.com>
@Snowapril Snowapril marked this pull request as ready for review April 26, 2022 12:10
Copy link
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

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

looks great!

@youknowone youknowone merged commit a19efa2 into RustPython:main Apr 26, 2022
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