(*args)
| 118 | for x in args) |
| 119 | |
| 120 | def _coerce_args(*args): |
| 121 | # Invokes decode if necessary to create str args |
| 122 | # and returns the coerced inputs along with |
| 123 | # an appropriate result coercion function |
| 124 | # - noop for str inputs |
| 125 | # - encoding function otherwise |
| 126 | str_input = None |
| 127 | for arg in args: |
| 128 | if arg: |
| 129 | if str_input is None: |
| 130 | str_input = isinstance(arg, str) |
| 131 | else: |
| 132 | if isinstance(arg, str) != str_input: |
| 133 | raise TypeError("Cannot mix str and non-str arguments") |
| 134 | if str_input is None: |
| 135 | for arg in args: |
| 136 | if arg is not None: |
| 137 | str_input = isinstance(arg, str) |
| 138 | break |
| 139 | if str_input is not False: |
| 140 | return args + (_noop,) |
| 141 | return _decode_args(args) + (_encode_result,) |
| 142 | |
| 143 | # Result objects are more helpful than simple tuples |
| 144 | class _ResultMixinStr(object): |
no test coverage detected
searching dependent graphs…