15.06.20 04:06, Greg Ewing пише:
Instead of a bunch of ad-hoc mechanisms for finding out about platform-dependent arguments, maybe there should be a function in the inspect module for testing whether a function has a given argument. Then you could say something like
if inspect.hasargument(glob.glob, 'dir_fd'): ...
How can the inspect module know? The function's signature is the same. Just not all values or types are accepted on all platforms.