Am 21.10.2010 16:06, schrieb Benjamin Peterson:
Raymond Hettinger <raymond.hettinger@...> writes:
One of the use cases for named tuples is to have them be automatically created
from a SQL query or CSV header.
Sometimes (but not often), those can have a huge number of columns. In Python
2.x, it worked just fine -- we
had a test for a named tuple with 5000 fields. In Python 3.x, there is a
SyntaxError when there are more than
I'm not sure why you think this is new. It's been true from at least 2.5 as far as I can see.
You must be talking of a different restriction. This snippet works fine in 2.7, but raises a SyntaxError in 3.1:
exec("def f(" + ", ".join("a%d" % i for i in range(1000)) + "): pass")