This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wietse.j
Recipients wietse.j
Date 2021-01-25.08:42:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611564175.96.0.494312223598.issue43021@roundup.psfhosted.org>
In-reply-to
Content
I suspect that I found a bug. If I run the following script:

```
def f(t=None):
    t0, t1 = t if t is not None else [], []
    return t0, t1


def g(t=None):
    if t is None:
        t = [], []
    t0, t1 = t
    return t0, t1


def test():
    res_f = f(t=([1, 1], [2, 2]))
    res_g = g(t=([1, 1], [2, 2]))
    assert res_f == res_g, f'{res_f=} != {res_g=}'


test()
```

I get an assertion error, with:

```
res_f=(([1, 1], [2, 2]), []) != res_g=([1, 1], [2, 2])
```

I expected them to be equal.
History
Date User Action Args
2021-01-25 08:42:56wietse.jsetrecipients: + wietse.j
2021-01-25 08:42:55wietse.jsetmessageid: <1611564175.96.0.494312223598.issue43021@roundup.psfhosted.org>
2021-01-25 08:42:55wietse.jlinkissue43021 messages
2021-01-25 08:42:55wietse.jcreate