Scott Dial wrote:
The regression is purely in the way an argument list is reduced to a dictionary.

To further elaborate:

Python 2.4:
>>> import dis
>>> dis.dis(compile('f(a=3, b=1, a=4)', '', 'eval'))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
SyntaxError: duplicate keyword argument

Python 2.5:
>>> import dis
>>> dis.dis(compile('f(a=3, b=1, a=4)', '', 'eval'))
  1           0 LOAD_NAME                0 (f)
              3 LOAD_CONST               0 ('a')
              6 LOAD_CONST               1 (3)
              9 LOAD_CONST               2 ('b')
             12 LOAD_CONST               3 (1)
             15 LOAD_CONST               0 ('a')
             18 LOAD_CONST               4 (4)
             21 CALL_FUNCTION          768
             24 RETURN_VALUE

The old compiler checked for this, but the AST-based compiler just blindly compiles the entire keyword argument sequence.

-Scott

--
Scott Dial
[EMAIL PROTECTED]
[EMAIL PROTECTED]
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to