Got warning: Couldn't retrieve source code for container

I probably typed that answer out from my phone, which is why it was concise.

Retrieving source code of a python class might happen for a variety of reasons, including:

  • If you defined the class in the interpreter directly (like in ipython terminal / notebook, or python shell)
  • If you only have access to .pyc files but not the original .py files
  • If the class itself was auto-generated

The warning exists to let the user know that we cannot do some sanity checks upon loading the class back, which are around checking if the source code of the old definition and new definition are different.

9 Likes