def argv_negative_fix(argv): """ Fixes the `argv` list by adding a space for input that may be float's """ rgv = [] for a in argv: try: strseq(complex, a) strmap(complex, a) except: rgv.append(a) else: rgv.append(' ' + a) return rgv
def argv_negative_fix(argv): """ Fixes `argv` list by adding a space for input that may be float's This function tries to prevent ``'-<>'`` being captured by `argparse`. Parameters ---------- argv : list of str the arguments passed to an argument-parser """ rgv = [] for a in argv: try: strseq(complex, a) strmap(complex, a) except: rgv.append(a) else: rgv.append(' ' + a) return rgv