Skip to main content

All Questions

-3 votes
1 answer
54 views

How to call a function ones and never compute again in python?

I have a function F() witch take lot of time but always return the same result. I would like to be able to skip this call and get directly the result next time I launch my program. How to do that?
Fractale's user avatar
  • 1,664
1 vote
1 answer
499 views

What's the closest implementation of scala's '@transient lazy val' in Python?

According to this post: Python memoising/deferred lookup property decorator A mnemonic decorator can be used to declare a lazy property in a class. There is even an 'official' package that can be ...
tribbloid's user avatar
  • 3,898
2 votes
3 answers
121 views

Evaluating dictionary value during json serialization

I'm trying to get a series of serialized dictionaries where only one specific value changes. the ficticious python dict named "obj" _gen = (value for value in range(5,10)) obj = {'mcu': {'led0': {'...
Daniel F's user avatar
  • 14.3k