From 1cfad096b9987e55b867c0538049538ae8968eaa Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Mon, 7 Jun 2010 10:50:29 -0700 Subject: [PATCH] Large integer literal type inference test. --- tests/run/type_inference.pyx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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) -- 2.26.2