os.walk() requires a top argument, and if you want the current dir, you need to specify . i.e. os.walk("."). However, os.fwalk() has a default top='.', so why doesn’t .walk()?
This would make it more convenient to walk the current dir.
This would also be good for comparison with os.listdir(), which has a default path='.', and is also used for listing files (similar to ls and find in Unix).
To be clear, I’m proposing changing def walk(top, ...) to def walk(top=".", ...) in os.py.
Cf def fwalk(top=".", ...)
It is supposed to pass dirfd to os.fwalk(). In that case top='.' is not the current directory, but the directory specified by dirfd. It is reasonable to make it default, so you do not need to pass top='.' each time you use dirfd.
In os.walk(), top='.' is not the most common case.
Alternatively, you could make fwalk()not a valid call by requiring top if dir_fd isn’t specified, like this:
def fwalk(top=None, ..., dir_fd=None):
if dir_fd is None and top is None:
raise TypeError('At least one of "dir_fd" and "top" must be provided.')
if top is None:
top = '.'