pythonwhat icon indicating copy to clipboard operation
pythonwhat copied to clipboard

Type-test has_output instead of requiring pattern=True

Open gvwilson opened this issue 6 years ago • 0 comments

Instead of has_output('some string', pattern=True), how about has_output(re.compile('some string')), i.e., use a type test inside has_output and apply the regex if one is given (match strings if not). This gets simpler if our code has:

from re import compile as rxc

so that the example above becomes has_output(rxc('some string')).

gvwilson avatar Jun 10 '18 17:06 gvwilson