14.06.20 23:45, Ivan Pozdeev via Python-Dev пише:
The documentation clearly says that it's supported depending on OS
flavor -- so if I want to know if I can supply it, I need to rather
os.name. Those members are thus redundant.
If the distinction is finer than os.name then I'd need some other, case-specific check depending on what the distinction is; alternatively, I could check the function's signature in its metadata if the support is reflected in it.
Yes, it is finer than os.name. It can depend on the kernel or libc version (and we do not know which versions are required on every platform), and there are a lot of platforms besides the main three. The user should not be expert in all platforms on which his program potentially can be ran.
The function's signature is the same on all platforms. Just on some platforms only default value can be passed (None for dir_fd) or only specific types of argument is accepted (path-like, but not int).