Skip to content

Normalize platform_system to sys_platform#9949

Merged
charliermarsh merged 2 commits intomainfrom
charlie/normalize
Dec 18, 2024
Merged

Normalize platform_system to sys_platform#9949
charliermarsh merged 2 commits intomainfrom
charlie/normalize

Conversation

@charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Dec 16, 2024

Summary

A revival of an old idea (#9344) that I have slightly more confidence in now. I abandoned this idea because (1) it couldn't capture that, e.g., platform_system == 'Windows' and sys_platform == 'foo' (or some other unknown value) are disjoint, and (2) I thought that Android returned "android" for one of sys_platform or platform_system, which would've made this logic incorrect.

However, it looks like Android... doesn't do that? And the values here are almost always in a small, known set. So in the end, the tradeoffs here actually seem pretty good.

Vis-a-vis our current solution, this can (e.g.) simplify out expressions like sys_platform == 'win32' or platform_system == 'Windows'.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants