MCPcopy Create free account
hub / github.com/ActiveState/code / ve2no

Function ve2no

recipes/Python/577197_SortedCollection/recipe-577197.py:199–204  ·  view source on GitHub ↗

Convert ValueError result to -1

(f, *args)

Source from the content-addressed store, hash-verified

197if __name__ == '__main__':
198
199 def ve2no(f, *args):
200 'Convert ValueError result to -1'
201 try:
202 return f(*args)
203 except ValueError:
204 return -1
205
206 def slow_index(seq, k):
207 'Location of match or -1 if not found'

Callers 1

recipe-577197.pyFile · 0.85

Calls 1

fFunction · 0.50

Tested by

no test coverage detected