1import cython 2 3def foo(egg): 4 if not cython.compiled: 5 egg = float(egg) 6 return egg 7 8def foo_defval(egg=1): 9 if not cython.compiled: 10 egg = float(egg) 11 return egg**2 12 13def cpfoo(egg=False): 14 if not cython.compiled: 15 egg = bool(egg) 16 v = int(not egg) 17 else: 18 v = not egg 19 return egg, v 20 21def test_pxd_locals(): 22 """ 23 >>> v1, v2, v3 = test_pxd_locals() 24 >>> isinstance(v1, float) 25 True 26 >>> isinstance(v2, float) 27 True 28 >>> v3 29 (True, 0) 30 """ 31 return foo(1), foo_defval(), cpfoo(1) 32