NO, it does not close the file type object. see this
The problem is that FileType can return stdin or stdout , so it cannot just close the file object.
A large number of unclosed file descriptors can cause problems for some operating systems, but it is. On the plus side, the fact that argparse accepts any callable for its argument type that can check and convert string input is simple, clean, and works.
Also see this
source share