paul j3 <ajipa...@gmail.com> added the comment:
While I continue to follow argparse issues, I'm not doing development (with my own repository, etc). I haven't revisited the issue since 2013, and don't know that much more about Python file handling. Occasionally 'FileType' issues come up on StackOverflow, and my most common suggestion is accept a string, and open the file yourself. In writing a solution, keep backward compatibility foremost in mind. We don't want to mess things up for existing code. And keep FileType simple, consistent with Steven's original intent - as a tool for simple input/output scripts. As for the idea of 2 - Making the argument namespace itself support context management someone could experiment with a new Namespace class with the proper enter/exit methods. The use of a custom Namespace class is documented https://docs.python.org/3/library/argparse.html#the-namespace-object So the idea can be implemented and thoroughly tested without altering the default Namespace class and its use. (With one caution, subparsers won't use this custom class.) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue13824> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com