CoCalc -- Collaborative Calculation in the Cloud
Sharedsupport / 2014-12-05 two squares.sagewsOpen in CoCalc

Examples for support purposes...

def no_except(f, err):
    def g(*args, **kwds):
        try:
            return f(*args, **kwds)
        except:
            return err
    return g
f = no_except(two_squares, [])
for k in xrange(10):
    print f(3437458237428-k), 3437458237428-k
[] 3437458237428 [] 3437458237427 (519651, 1779725) 3437458237426 [] 3437458237425 [] 3437458237424 [] 3437458237423 [] 3437458237422 [] 3437458237421 [] 3437458237420 [] 3437458237419