Repository navigation
Conversation
This will be nice mainly for windows. The only problem here is right now that we cannot define the macros like this, since they would be public. They should not be made public (at least like this), since if someone uses NPY_DEFAULT_INT in their code they should get the default they are running against, not the one they are compiled against.
|
Oh, nice example of what can go wrong. Legacy random fails because it allocates default integer arrays (with |
|
Closing this for now, was mostly curious what fails on windows. The |
Can we move forward with #14882 to try and resolve that trap? |
|
@eric-wieser if you want to review this, I am happy to reopen and just move it forward now. Right now it just adds a flag after all, so the trap is probably even OK (if documented). But yes, that one should move as well. Fixing up random should be very simple, just replacing a few |
Are you looking for |
|
@eric-wieser I suppose so, although it is a bit annoying that with this change, you would have |
|
I think if you went down this route you'd probably also want to deprecate |
This will be nice mainly for windows. The only problem here is
right now that we cannot define the macros like this, since they
would be public. They should not be made public (at least like this),
since if someone uses NPY_DEFAULT_INT in their code they should get
the default they are running against, not the one they are compiled
against.
I think we should explore such things and this seems the best first step to me, the changes themselves are easy enough after all. May need someone to test on windows to be sure it works (and likely some test fixups found by CI). Marking as draft, since there are probably fixups necessary when tested on windows...
See also gh-6056 or gh-12332, although this uses the
intpoption, which seems a bit easier to me, because we return and useintpin a lot of places and many of those might otherwise need to be bumped up as well for a uniform user-experience...At least with
np.intpas default, the rule is smiple 64bit on 64bit systems, 32bit on 32bit.I think we should change this, but I believe flipping the switch is a pretty big API change (even if it is one that very few users will notice).