summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-12-16 17:19:02 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-12-16 17:19:02 (GMT)
commit5bb8b9134b0bb35a73c76657f41cafa3e4361fcd (patch)
tree5755343717913be71dc48d94db681d1a21ff31d2 /Lib/test/test_compile.py
parent14d8b9693be235240ab2dcac3b43a4a7c30483bc (diff)
downloadcpython-5bb8b9134b0bb35a73c76657f41cafa3e4361fcd.zip
cpython-5bb8b9134b0bb35a73c76657f41cafa3e4361fcd.tar.gz
cpython-5bb8b9134b0bb35a73c76657f41cafa3e4361fcd.tar.bz2
Issue #18896: Python function can now have more than 255 parameters.
collections.namedtuple() now supports tuples with more than 255 elements.
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 409ec86..4a7230f 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -401,16 +401,9 @@ if 1:
self.assertNotIn((Ellipsis, Ellipsis), d)
def test_annotation_limit(self):
- # 16 bits are available for # of annotations, but only 8 bits are
- # available for the parameter count, hence 255
- # is the max. Ensure the result of too many annotations is a
- # SyntaxError.
+ # more than 255 annotations, should compile ok
s = "def f(%s): pass"
- s %= ', '.join('a%d:%d' % (i,i) for i in range(256))
- self.assertRaises(SyntaxError, compile, s, '?', 'exec')
- # Test that the max # of annotations compiles.
- s = "def f(%s): pass"
- s %= ', '.join('a%d:%d' % (i,i) for i in range(255))
+ s %= ', '.join('a%d:%d' % (i,i) for i in range(300))
compile(s, '?', 'exec')
def test_mangling(self):