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 eric.smith, martinmeo
Date 2019-12-18.01:58:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1576634336.6.0.0275807301385.issue39083@roundup.psfhosted.org>
In-reply-to
Content
.get() is just a regular function call. And like all python functions, all of the arguments are evaluated before the function is called. There is no mechanism in python to delay the evaluation of a arguments.

You might want to look at collections.defaultdict. You can supply a factory function, so that the call is delayed until a missing key is found.
History
Date User Action Args
2019-12-18 01:58:56eric.smithsetrecipients: + eric.smith, martinmeo
2019-12-18 01:58:56eric.smithsetmessageid: <1576634336.6.0.0275807301385.issue39083@roundup.psfhosted.org>
2019-12-18 01:58:56eric.smithlinkissue39083 messages
2019-12-18 01:58:56eric.smithcreate