bpo-29435: Allow is_tarfile to take a filelike obj (GH-18090)

`is_tarfile()` now supports `name` being a file or file-like object.
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index c34f2c4..459e4ad 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -159,7 +159,10 @@
 .. function:: is_tarfile(name)
 
    Return :const:`True` if *name* is a tar archive file, that the :mod:`tarfile`
-   module can read.
+   module can read. *name* may be a :class:`str`, file, or file-like object.
+
+   .. versionchanged:: 3.9
+      Support for file and file-like objects.
 
 
 The :mod:`tarfile` module defines the following exceptions: