In Python 3.3 a number of functions in the os module got the support of new options, like dir_fd or follow_symlinks. I well remember this because the initial reason of my contribution to CPython was related to this feature.
The support of new options was platform dependent. They were supported only on some Posix platforms, but not on Windows. Sets like supports_dir_fd and supports_follow_symlinks was added in the os module to specify which functions support which options. If say os.stat is contained in os.supports_dir_fd, then os.stat() supports keyword argument dir_fd.
Now I want to add the support of dir_fd to glob.glob() and some other functions. It will be platform-dependent, it requires os.open() and os.stat() supporting dir_fd and os.scandir supporting the file descriptor argument. How can I specify that glob.glob() supports dir_fd?
Add glob.glob in os.supports_dir_fd? It looks strange that importing the glob module modifies the value of the os module.
Introduce the glob.supports_dir_fd set and add glob.glob to it? We will need to add sets supports_dir_fd in all modules which contain functions which can support dir_fd. But what if the function is defined in one module, by normally is imported from other module? Should we merge sets supports_dir_fd from different modules?
Also, the common problem with two former options is that when we wrap the function, we need to add it to the corresponding set.
What are your thoughts?