[issue43227] Backslashes in function arguments in f-string expressions

2021-02-14 Thread Thomas Nabelek
New submission from Thomas Nabelek : >From https://www.python.org/dev/peps/pep-0498/#escape-sequences: "Backslashes may not appear inside the expression portions of f-strings" Is this supposed to be true even for arguments to functions inside of the expression? my_str = &quo

[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-19 Thread Thomas Nabelek
Thomas Nabelek added the comment: For anyone else, here is my implementation. I decided not to do anything to support comments on the same lines as arguments. import argparse import re # Override argparse's convert_arg_line_to_args method to allow for comments and empty lines class

[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-19 Thread Thomas Nabelek
Thomas Nabelek added the comment: Oh, yes, returning [] does work. Thanks guys. -- ___ Python tracker <https://bugs.python.org/issue42677> ___ ___ Python-bug

[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-19 Thread Thomas Nabelek
Thomas Nabelek added the comment: While overloading convert_arg_line_to_args may work, I think that @file reading is kind of the odd ball out in not recognizing '#' as the beginning of a comment. Besides, I'm not sure that overloading just convert_arg_line_to_args is sufficient. Here

[issue42677] Support comments in argparse fromfile_prefix_chars files

2020-12-18 Thread Thomas Nabelek
New submission from Thomas Nabelek : For input argument files, specified with the fromfile_prefix_chars argument to argparse.ArgumentParser, argparse should ignore lines beginning with '#' so that comments can be used in those files. -- components: Library (Lib) messages: 383321 nosy