From c4c8434789005916e28d86f878cf1bee696f322d Mon Sep 17 00:00:00 2001 From: Ken Williams Date: Thu, 11 Jan 2024 10:47:40 -0600 Subject: [PATCH] Fix formatting of python code --- MIGRATING_FROM_OLDER_VERSIONS.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MIGRATING_FROM_OLDER_VERSIONS.rst b/MIGRATING_FROM_OLDER_VERSIONS.rst index 96115a51..9291493a 100644 --- a/MIGRATING_FROM_OLDER_VERSIONS.rst +++ b/MIGRATING_FROM_OLDER_VERSIONS.rst @@ -4,17 +4,17 @@ Migrating to the new compression parameter smart_open versions 6.0.0 and above no longer support the ``ignore_ext`` parameter. Use the ``compression`` parameter instead: -```python -fin = smart_open.open("/path/file.gz", ignore_ext=True) # No -fin = smart_open.open("/path/file.gz", compression="disable") # Yes - -fin = smart_open.open("/path/file.gz", ignore_ext=False) # No -fin = smart_open.open("/path/file.gz") # Yes -fin = smart_open.open("/path/file.gz", compression="infer_from_extension") # Yes, if you want to be explicit +.. code-block:: python -fin = smart_open.open("/path/file", compression=".gz") # Yes + fin = smart_open.open("/path/file.gz", ignore_ext=True) # No + fin = smart_open.open("/path/file.gz", compression="disable") # Yes + + fin = smart_open.open("/path/file.gz", ignore_ext=False) # No + fin = smart_open.open("/path/file.gz") # Yes + fin = smart_open.open("/path/file.gz", compression="infer_from_extension") # Yes, if you want to be explicit + + fin = smart_open.open("/path/file", compression=".gz") # Yes -``` Migrating to the new client-based S3 API ========================================