crates/ty_python_semantic/resources/mdtest/os_name.md
os.nameall platformsWhen python-platform="all" is specified, we fall back to the type of os.name declared in
typeshed:
[environment]
python-platform = "all"
import os
reveal_type(os.name) # revealed: LiteralString
[environment]
python-platform = "win32"
import os
reveal_type(os.name) # revealed: Literal["nt"]
[environment]
python-platform = "linux"
import os
reveal_type(os.name) # revealed: Literal["posix"]
[environment]
python-platform = "linux"
import os
if os.name == "nt":
windows = True
else:
posix = True
# error: [unresolved-reference]
windows
# no error
posix
if os.name == "nt":
os.startfile("foo.txt")
[environment]
python-platform = "win32"
import os
if os.name != "nt":
os.uname()
if os.name == "nt":
os.startfile("foo.txt")