tests: Add test for evaluation order of dictionary key/value pairs.

In Python 3.4 the value is evaluated before the key.  In Python 3.5 it's
key then value.
mp_obj_new_bool
Damien George 2015-10-08 13:15:07 +01:00
parent 9f5f156b9d
commit 4fb5ff86ee
2 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,9 @@ def print_ret(x):
return x return x
f4(*print_ret(['a', 'b']), kw_arg=print_ret(None)) f4(*print_ret(['a', 'b']), kw_arg=print_ret(None))
# test evaluation order of dictionary key/value pair (in 3.4 it's backwards)
{print_ret(1):print_ret(2)}
# from basics/syntaxerror.py # from basics/syntaxerror.py
# can't have multiple * or ** (in 3.5 we can) # can't have multiple * or ** (in 3.5 we can)
def test_syntax(code): def test_syntax(code):

View File

@ -1,6 +1,8 @@
None None
['a', 'b'] ['a', 'b']
('a', 'b') {'kw_arg': None} ('a', 'b') {'kw_arg': None}
2
1
SyntaxError SyntaxError
SyntaxError SyntaxError
3.4 3.4