Issue #18193: Add importlib.reload(), documenting (but not
implementing in code) the deprecation of imp.reload().

Thanks to Berker Peksag for the patch.
diff --git a/Lib/imp.py b/Lib/imp.py
index 5170b06..ad0fd6a 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -23,6 +23,7 @@
 
 from importlib import _bootstrap
 from importlib import machinery
+import importlib
 import os
 import sys
 import tokenize
@@ -246,31 +247,12 @@
     return file, file_path, (suffix, mode, type_)
 
 
-_RELOADING = {}
-
 def reload(module):
-    """Reload the module and return it.
+    """**DEPRECATED**
+
+    Reload the module and return it.
 
     The module must have been successfully imported before.
 
     """
-    if not module or type(module) != type(sys):
-        raise TypeError("reload() argument must be module")
-    name = module.__name__
-    if name not in sys.modules:
-        msg = "module {} not in sys.modules"
-        raise ImportError(msg.format(name), name=name)
-    if name in _RELOADING:
-        return _RELOADING[name]
-    _RELOADING[name] = module
-    try:
-        parent_name = name.rpartition('.')[0]
-        if parent_name and parent_name not in sys.modules:
-            msg = "parent {!r} not in sys.modules"
-            raise ImportError(msg.format(parentname), name=parent_name)
-        return module.__loader__.load_module(name)
-    finally:
-        try:
-            del _RELOADING[name]
-        except KeyError:
-            pass
+    return importlib.reload(module)
diff --git a/Lib/importlib/__init__.py b/Lib/importlib/__init__.py
index df893cc..83de028 100644
--- a/Lib/importlib/__init__.py
+++ b/Lib/importlib/__init__.py
@@ -1,5 +1,5 @@
 """A pure Python implementation of import."""
-__all__ = ['__import__', 'import_module', 'invalidate_caches']
+__all__ = ['__import__', 'import_module', 'invalidate_caches', 'reload']
 
 # Bootstrap help #####################################################
 
@@ -11,6 +11,7 @@
 # initialised below if the frozen one is not available).
 import _imp  # Just the builtin component, NOT the full Python module
 import sys
+import types
 
 try:
     import _frozen_importlib as _bootstrap
@@ -90,3 +91,34 @@
                 break
             level += 1
     return _bootstrap._gcd_import(name[level:], package, level)
+
+
+_RELOADING = {}
+
+
+def reload(module):
+    """Reload the module and return it.
+
+    The module must have been successfully imported before.
+
+    """
+    if not module or not isinstance(module, types.ModuleType):
+        raise TypeError("reload() argument must be module")
+    name = module.__name__
+    if name not in sys.modules:
+        msg = "module {} not in sys.modules"
+        raise ImportError(msg.format(name), name=name)
+    if name in _RELOADING:
+        return _RELOADING[name]
+    _RELOADING[name] = module
+    try:
+        parent_name = name.rpartition('.')[0]
+        if parent_name and parent_name not in sys.modules:
+            msg = "parent {!r} not in sys.modules"
+            raise ImportError(msg.format(parentname), name=parent_name)
+        return module.__loader__.load_module(name)
+    finally:
+        try:
+            del _RELOADING[name]
+        except KeyError:
+            pass
diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py
index 297d6cb..330c04e 100644
--- a/Lib/test/test_importlib/test_api.py
+++ b/Lib/test/test_importlib/test_api.py
@@ -151,6 +151,18 @@
         self.assertIsNone(importlib.find_loader('nevergoingtofindthismodule'))
 
 
+class ReloadTests(unittest.TestCase):
+
+    """Test module reloading for builtin and extension modules."""
+
+    def test_reload_modules(self):
+        for mod in ('tokenize', 'time', 'marshal'):
+            with self.subTest(module=mod):
+                with support.CleanImport(mod):
+                    module = importlib.import_module(mod)
+                    importlib.reload(module)
+
+
 class InvalidateCacheTests(unittest.TestCase):
 
     def test_method_called(self):