Eric V. Smith <e...@trueblade.com> added the comment:

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.

----------
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38998>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to