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 mark.dickinson
Recipients Dennis Sweeney, mark.dickinson, serhiy.storchaka, steven.daprano, terry.reedy
Date 2022-01-16.08:50:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642323008.02.0.562629754476.issue46393@roundup.psfhosted.org>
In-reply-to
Content
[Terry]
> To avoid the intermediate set, [...]

It's not quite as bad as that: there _is_ no intermediate set (or if you prefer, the intermediate set is the same object as the final set), since the frozenset call returns its argument unchanged if it's already of exact type frozenset:

>>> x = frozenset({1, 2, 3})
>>> y = frozenset(x)
>>> y is x
True

Relevant source: https://github.com/python/cpython/blob/09087b8519316608b85131ee7455b664c00c38d2/Objects/setobject.c#L999-L1003
History
Date User Action Args
2022-01-16 08:50:08mark.dickinsonsetrecipients: + mark.dickinson, terry.reedy, steven.daprano, serhiy.storchaka, Dennis Sweeney
2022-01-16 08:50:08mark.dickinsonsetmessageid: <1642323008.02.0.562629754476.issue46393@roundup.psfhosted.org>
2022-01-16 08:50:08mark.dickinsonlinkissue46393 messages
2022-01-16 08:50:07mark.dickinsoncreate