Platform: An Enumeration of Supported Operating Systems#
- class my.types.Platform.Platform(*values)#
An enumeration of supported platforms, as combinable bitwise flags.
The desktop members are
GNU,MAC, andDOS; the mobile membersIOSandANDROIDare defined as unions that includeMOBILEand their parent desktop family, so flag containment checks read naturally.NONE,OLD, andERRcover the degenerate cases.Examples
Test family membership via flag containment:
>>> from my import Platform >>> Platform.MAC in Platform.IOS True >>> Platform.MOBILE in Platform.ANDROID True >>> Platform.DOS in Platform.IOS False
Detect the platform of the current host (e.g. on a Linux machine):
>>> Platform.local() <Platform.GNU: 4>