If I import some module and then change its content python uses cache and doesn't see the changes. To sort that out I can remove __pycache__ directory or do sys.modules.pop("my_module"). But I wonder if there're any time after which python cached files are invalidated automatically?
The problem was, that I was using the same IPython REPL session. So it used the  cached file and didn't invalidate it. When I opened new python shell or just run import inside a python file - cache was invalidated every time the content of imported module is changed.
Is there any TTL of python cache