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

Disable fast_getattr to allow usage of memoryview? #38839

Open
1 task done
user202729 opened this issue Oct 22, 2024 · 1 comment
Open
1 task done

Disable fast_getattr to allow usage of memoryview? #38839

user202729 opened this issue Oct 22, 2024 · 1 comment

Comments

@user202729
Copy link
Contributor

Problem Description

Currently, we cannot use memoryview in SageMath because of what appears to be a cython bug: cython/cython#6442

As recommended in cython documentation, typed memoryview is preferred to the numpy.ndarray[...] syntax.

Proposed Solution

We disable fast_getattr as suggested in the cython bug linked above.

Side note, the commit that introduces fast_getattr is 7f33b86 which is #10493
--- however I can't find any discussion on why the fast_getattr is added?

Alternatives Considered

Additional Information

No response

Is there an existing issue for this?

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
@da-woods
Copy link

My working theory is that the directive isn't actually doing much - it prevents Cython from creating a __getattr__ C method in the class. However that just affects what happens if you do Cls.__getattr__ or Cls().__getattr__. I don't think it has any impact at all on the speed of attribute lookup.

So it'd be good to know if I'm missing something and there's actually a good reason for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants