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

Update catom to use fastcalls #232

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

frmdstryr
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.67%. Comparing base (9b80362) to head (d12ce27).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #232   +/-   ##
=======================================
  Coverage   97.67%   97.67%           
=======================================
  Files          24       24           
  Lines        1074     1074           
  Branches      162      162           
=======================================
  Hits         1049     1049           
  Misses         12       12           
  Partials       13       13           

@frmdstryr
Copy link
Contributor Author

I think CAtom_setstate needs reworked, idk what I was doing back then...

{
if( PyTuple_GET_SIZE( args ) != 1 )
return cppy::type_error( "__setstate__() takes exactly one argument" );
PyObject* state = PyTuple_GET_ITEM( args, 0 );
cppy::ptr itemsptr = PyMapping_Items(state);
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a PyMapping_Check before this?

That said, PyMapping_Check doesn't even check for items().

Should we force it to be a dict?

Some of the below logic is questionable and may need some attention. I don't think that __setstate__ should trigger observers, which means it shouldn't go thru the __setattr__ protocol.

Copy link
Member

@sccolbert sccolbert left a comment

Choose a reason for hiding this comment

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

I agree with everything except the __setstate__ method. I think that should be handled in a separate PR where we fix/agree on the behavior of that method.

@frmdstryr
Copy link
Contributor Author

Agree, I amended it to remove those changes.

@MatthieuDartiailh MatthieuDartiailh merged commit e890d73 into nucleic:main Jan 20, 2025
18 checks passed
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