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
Clean up dict_del_by_value #23414
Comments
Branch: u/jdemeyer/ticket/23414 |
comment:2
I intentionally kept the definitions of New commits:
|
Commit: |
comment:3
Replying to @nbruin:
The main reason is to eventually move those to Cython itself. Usually, Cython upstream welcomes additional declarations regarding the CPython API. |
comment:5
Replying to @jdemeyer:
OK. The part of the API that gets exposed is indeed part of what On the other hand, the file backports Furthermore, the main purpose of this module is to provide a function that is badly bound to unpublished implementation details of dictionaries. As far as I know, the routine provided here is only a good idea for an improved implementation of I'm a little hesitant to name this a good API choice. Since this ticket is only about refactoring, I think we only want to merge it if it actually improves the API and the reasons above make me doubt that. I don't think the change proposed is disastrous either, so if there's another reviewer who thinks the proposed change really does provide an improvement, I won't argue. The easiest way to accomplish integration into cython is probably just to generate a pull request to include these definitions into It'll be relatively complicated, because Cython tries to generate C-code that can be compiled against |
comment:6
When talking about moving to Cython, I meant just the declarations of the structs, not everything in this Sage module. |
comment:7
Replying to @nbruin:
I usually prefer to put the code in Sage first, as some kind of testcase. When it's been shown that the Sage code works, I'll make a pull request. Otherwise, you might end up in a situation where you first make a pull request and then realize that it doesn't quite work. |
comment:8
Replying to @jdemeyer:
Yes, I understand. I think moving those to cython would be fine. The problem with the structs is that these are incompatible between Py2/Py3 and that code for one will not compile on the other. And I'm not sure that taking the union of the two on the cython level is the best way to handle (hide) this incompatibility. I also don't think sage is a great testing ground for Py2/Py3 compatibility just yet, because it doesn't really get compiled on Py3 yet. My main concern is that this module, because it implements relatively dangerous stuff, is not an appropriate testing ground either. |
comment:9
Replying to @nbruin:
Well, it is a testing ground to ensure that stuff compiles, which is really the only thing which could go wrong with the |
comment:10
Replying to @nbruin:
It's simple, it works. Why not? |
comment:11
Replying to @jdemeyer:
It just looks wrong to me because the struct definition is not a subset of the fields available (not on Py2 and not on Py3), and there's a struct definition that is not available on Py3. I was hoping to help and review this ticket, but I don't feel this is within my expertise. I'd be comfortable if the different structs were guarded by a |
comment:12
Replying to @jdemeyer:
That's not the issue: You're adding functionality to the |
comment:13
does not apply |
Depends on #23413
Component: cython
Author: Jeroen Demeyer
Branch/Commit: u/jdemeyer/ticket/23414 @
cc7de2c
Issue created by migration from https://trac.sagemath.org/ticket/23414
The text was updated successfully, but these errors were encountered: