Add note on using itertools.dropwhile() for efficiency in _is_allowed().
* If/when it's rewritten, a simple speed/efficiency check can be done with: >>> import dis >>> dis.dis(_is_allowed_orig('--dragons')) >>> dis.dis(_is_allowed_orig('--encrypt')) >>> dis.dis(_is_allowed_new('--dragons')) >>> dis.dis(_is_allowed_new('--encrypt'))testing/mmn/mktime_takes_localtime_not_gmtime
parent
69c6981b66
commit
f65022500d
|
@ -404,6 +404,7 @@ def _is_allowed(input):
|
|||
hyphenated = _hyphenate(input)
|
||||
else:
|
||||
hyphenated = input
|
||||
## xxx we probably want to use itertools.dropwhile here
|
||||
try:
|
||||
assert hyphenated in allowed
|
||||
except AssertionError as ae:
|
||||
|
|
Loading…
Reference in New Issue