Since there is no way to file a bug, I'll post it here.. Honestly, I haven't seen such a broken and inconsistent API from production system yet in my life..

what is worse - this same issue is in 'os' module:

And their UI (despite actually showing the file and folder simultaneously):
