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 eric.smith
Recipients da-dada, eric.smith, remi.lapeyre
Date 2019-12-08.19:39:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1575833969.86.0.710742238017.issue38998@roundup.psfhosted.org>
In-reply-to
Content
Right. If you want the value only calculated once, then just call it once.

You might be interested in collections.defaultdict, which takes a factory function, and only calls it as needed.
History
Date User Action Args
2019-12-08 19:39:29eric.smithsetrecipients: + eric.smith, remi.lapeyre, da-dada
2019-12-08 19:39:29eric.smithsetmessageid: <1575833969.86.0.710742238017.issue38998@roundup.psfhosted.org>
2019-12-08 19:39:29eric.smithlinkissue38998 messages
2019-12-08 19:39:29eric.smithcreate