Patch by Itamar S.T. (SF#305470): add reset() method.
diff --git a/Lib/dircache.py b/Lib/dircache.py
index a999743..6171ff8 100644
--- a/Lib/dircache.py
+++ b/Lib/dircache.py
@@ -6,10 +6,15 @@
 
 import os
 
-__all__ = ["listdir","opendir","annotate"]
+__all__ = ["listdir", "opendir", "annotate", "reset"]
 
 cache = {}
 
+def reset():
+      """Reset the cache completely."""
+      global cache
+      cache = {}
+
 def listdir(path):
     """List directory contents, using cache."""
     try: