-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
extend sys
module on windows
#102536
Comments
Yeah, I don't think we want to bother with making them required attributes, so I'd add:
|
Is |
The only real alternative is at the top level of the I assume this hasn't come up before because Windows is the only OS with transparent CPU emulation? So querying the current OS architecture isn't sufficient to determine the current process architecture. |
|
Really it should be What if we added |
There are multiple existing APIs to do that. Examples:
I don't think that we should add information retrieved at runtime in sys. Usually, sys is more information computed during the build. |
But you're correct that we don't need to retrieve it at runtime. (Though worth noting that a lot of |
Hmmm. Actually, the discussion in the PR failed because no one decided whether to merge it or not (it seems that the only supporter is @zooba). link: |
My main concern was/is that this information doesn't belong on Something like All that said, I haven't looked closely at what we're trying to actually accomplish here, so I don't have much feedback on that. |
I'm often the only supporter of things involving Windows :-) Usually aggregated from a lot of discussions with a range of users, but not easily cited (many Windows users are scared off by the culture here, so they won't report stuff themselves). In this case, we've been looking at adding support to project's build scripts to allow building on Windows ARM64, which requires the builder to know whether it should be targeted ARM64 or not. That's usually done by running in the ARM64 interpreter, and then to cross-compile you'd run in the x64 or x86 interpreter, but we don't currently have a reliable way to detect that. Historically we haven't needed it, because More importantly, and relevant for this case, is that Having now re-read that PEP though,1 I think we should drop the underscore. Make it Footnotes
|
|
|
|
I agree. If I remember correctly, the win kernel is actually simulating multiple subsystems at the same time (such as win32. It's used to be compatible with historical calls). Maybe when building, it's in |
OK, I think I understand Steve's point of view now. There's precedent for this in the stdlib: we're using Line 889 in 10c4c95
I'm only comfortable with Alternatively, we could add a public |
I think that for |
If we go for |
As far as the discussion is concerned, it seems that only the |
My main hesitation with defining it as public |
Platforms that use our |
The |
The Storing a single value somewhere in a native module is much easier on Windows than adding an entirely new static file that is generated at compile time. The question is about where we should store the value, more than where it gets retrieved from. |
Actually, I was just surprised to learn that it looks like a Footnotes
|
IMO, this should be implemented by adding |
Ah, so it has.
Given that we can embed it at compile time, I'm fine with this. Do we have official target triples for Windows? Or do we just borrow them from someone else (I'm pretty sure Rust uses them, yeah?) |
I actually have no problem with adding the arch member to @zooba, what do you think about this? |
It would be added to the We need a spec for |
That is, it should look like this
Edit |
Well, if |
If you want to access build information, At the time, the platform module was conceived, there was no ARM64 architecture and only 32bit vs. 64bit was important. It's certainly possible to add another argument |
Maybe add an |
It would be useful to be able to detect:
@zooba you mentioned adding them to
sys.implementation
. Since they are only available on windows, I assume this would mean adding them with an underscore prefix? The alternative would be a separate API similar tosys.winver
.This is a follow up to #102256.
Linked PRs
_architecture
field tosys.implementation
#124582The text was updated successfully, but these errors were encountered: