You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh-39776: Safeguard _sage_getargspec_cython
Fix#39735
Actually just a workaround, this sweeps the fundamental problem under
the rug.
Without source available:
```
sage: from sage.structure.category_object import CategoryObject
sage: CategoryObject._CategoryObject__gens_dict
Cached version of <method '_CategoryObject__gens_dict' of
'sage.structure.category_object.CategoryObject' objects>
sage: type(CategoryObject._CategoryObject__gens_dict)
<class 'sage.misc.cachefunc.CachedMethodCaller'>
```
With source available (specialized version `CachedMethodCallerNoArgs` is
used, thus more efficient):
```
sage: from sage.structure.category_object import CategoryObject
sage: CategoryObject._CategoryObject__gens_dict
Cached version of <method '_CategoryObject__gens_dict' of
'sage.structure.category_object.CategoryObject' objects>
sage: type(CategoryObject._CategoryObject__gens_dict)
<class 'sage.misc.cachefunc.CachedMethodCallerNoArgs'>
```
The proper fix should be to either somehow make `sage_getargspec` always
return the correct value,
or to somehow make the cache function mechanism know when to use
specialization.
In any case, it can't hurt to make the function raise the correct
exception type.
### 📝 Checklist
<!-- Put an `x` in all the boxes that apply. -->
- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.
### ⌛ Dependencies
<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - #12345: short description why this is a dependency -->
<!-- - #34567: ... -->
URL: #39776
Reported by: user202729
Reviewer(s): Tobias Diez, user202729
0 commit comments