From: Robert Bradshaw Date: Mon, 7 Jun 2010 17:50:29 +0000 (-0700) Subject: Large integer literal type inference test. X-Git-Tag: 0.13.beta0~52 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1cfad096b9987e55b867c0538049538ae8968eaa;p=cython.git Large integer literal type inference test. --- diff --git a/tests/run/type_inference.pyx b/tests/run/type_inference.pyx index 96021075..d9d7293d 100644 --- a/tests/run/type_inference.pyx +++ b/tests/run/type_inference.pyx @@ -417,3 +417,18 @@ def common_extension_type_base(): w = A() w = CC() assert typeof(w) == "Python object", typeof(w) + + +@infer_types(None) +def large_literals(): + """ + >>> large_literals() + """ + # It's only safe to infer small integer literals. + a = 10 + b = 100000000000000000000000000000000 + assert typeof(a) == "long", typeof(a) + assert typeof(b) == "Python object", typeof(b) + c, d = 10, 100000000000000000000000000000000 + assert typeof(c) == "long", typeof(c) + assert typeof(d) == "Python object", typeof(d)