https://github.com/python/cpython/commit/c7a097c02ed4df9af227736e8bdc7d51e891eb83 commit: c7a097c02ed4df9af227736e8bdc7d51e891eb83 branch: main author: R Chintan Meher <[email protected]> committer: AA-Turner <[email protected]> date: 2025-08-31T01:50:56+01:00 summary:
gh-133829: Remove some specifics from the ``zipimport`` example (#133835) Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: sobolevn <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> files: M Doc/library/zipimport.rst diff --git a/Doc/library/zipimport.rst b/Doc/library/zipimport.rst index 19ae12bd4050cf..851ef1128dde62 100644 --- a/Doc/library/zipimport.rst +++ b/Doc/library/zipimport.rst @@ -177,17 +177,20 @@ Here is an example that imports a module from a ZIP archive - note that the .. code-block:: shell-session - $ unzip -l example.zip - Archive: example.zip + $ unzip -l example_archive.zip + Archive: example_archive.zip Length Date Time Name -------- ---- ---- ---- - 8467 11-26-02 22:30 jwzthreading.py + 8467 01-01-00 12:30 example.py -------- ------- 8467 1 file - $ ./python - Python 2.3 (#1, Aug 1 2003, 19:54:32) + +.. code-block:: pycon + >>> import sys - >>> sys.path.insert(0, 'example.zip') # Add .zip file to front of path - >>> import jwzthreading - >>> jwzthreading.__file__ - 'example.zip/jwzthreading.py' + >>> # Add the archive to the front of the module search path + >>> sys.path.insert(0, 'example_archive.zip') + >>> import example + >>> example.__file__ + 'example_archive.zip/example.py' + _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
