Skip to content

Options for shorthand for sys.platform checks #1953

Answered by JelleZijlstra
Josverl asked this question in Q&A

You must be logged in to vote

I think it would be useful to specify sys.platform checks in more detail and add other useful patterns. For your example, it would be nice to support if sys.platform in ('x', 'y'):. Maybe there could also be a good way to support some version of "if on pypy", "if on cpython", "if on micropython".

If you're interested in pursuing this, I'd advise you to first start a thread on discuss.python.org, with the aim of brainstorming a concrete proposal. Then turn that into a PR to the typing spec, and follow the procedure in https://github.com/python/typing-council/#decisions to get the change into the spec.

Replies: 2 comments 1 reply

You must be logged in to vote
0 replies

You must be logged in to vote
1 reply
@Josverl

Answer selected by Josverl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants