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 pablogsal
Recipients Anthony Sottile, pablogsal
Date 2020-01-05.10:08:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1578218888.68.0.377429481427.issue39216@roundup.psfhosted.org>
In-reply-to
Content
Hi Anthony,

> not sure if this is intentional or not

Thanks for the catch! Is not intentional. Could you made a PR adding the line?

> Happy to make a patch which adds a line there if someone can help me with the test

We do not have explicit tests for constant folding in the ast level an, in this case, is going to be folded anyway via another code path. For example:

def g():
    def f(x : 3 in {1,2,3}, /): ...
    return f

print(g.__code__.co_consts[2])
frozenset({1, 2, 3})
History
Date User Action Args
2020-01-05 10:08:08pablogsalsetrecipients: + pablogsal, Anthony Sottile
2020-01-05 10:08:08pablogsalsetmessageid: <1578218888.68.0.377429481427.issue39216@roundup.psfhosted.org>
2020-01-05 10:08:08pablogsallinkissue39216 messages
2020-01-05 10:08:08pablogsalcreate