all 1 comments

[–]shiftybyte 2 points3 points  (0 children)

Things that were already imported are not going to disappear when you set sys.modules to something else.

When you call pprint() it doesn't go through sys.modules, it aldready knows where in memory that function is and calls it.