IMO it is up to the offending module to provide an API for advertising which variant of those functions is accepted. This seems out of scope for inspect.

On Sun, Jun 14, 2020 at 23:16 Ivan Pozdeev via Python-Dev <> wrote:

On 15.06.2020 8:45, Serhiy Storchaka wrote:
> 14.06.20 23:45, Ivan Pozdeev via Python-Dev пише:
>> 1. 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
>> check ``. Those members are thus redundant.
>>      If the distinction is finer than 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 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).

Then a single boolean flag is clearly not enough. Compare: in , the set of present RLIMIT_*
members shows which rlimits are available in the specific OS.

So I guess you want some similar pointers that would show which relevant #define constants (or other C-level entities that govern the
availability) were present at the time of compilation.
If availability is rather governed by a runtime than compile-time check, then something to perform the same check should be introduced; the
distinction from .supports_stuff is it would be named after the check and completely decoupled from any functions that might be affected by
the check.

> _______________________________________________
> Python-Dev mailing list --
> To unsubscribe send an email to
> Message archived at
> Code of Conduct:
> --
> Regards,
> Ivan
Python-Dev mailing list --
To unsubscribe send an email to
Message archived at
Code of Conduct:
--Guido (mobile)