Changeset 1895:3c3ac50e0334


Ignore:
Timestamp:
Jan 1, 2020, 10:35:13 PM (3 months ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
amend_source:
594eaf582c7f8eb951e7c66f4e4f5282261e26c9
Message:
Make `rest` a keyword-only argument

This applies to `FTPHost.open` and `FTPFile._open`. The latter is only
used internally.

Making `rest` a keyword-only argument has several reasons:

- Python's built-in `open` has two additional arguments that aren't
  supported in `FTPHost.open`, i. e. they're not in `FTPHost.open`'s
  argument list. Using `rest` as a positional argument may create
  confusion about the role of this positional argument. (The position
  7 has completely different semantics in Python's `open` and
  `FTPHost.open`.)

- Adding other `open` arguments modeled after Python's `open` will
  be easier. These arguments can now get the corresponding positions
  as in Python's `open`.

- The `rest` argument probably is rarely used, especially as a
  positional argument, so very few people would be affected.
Location:
ftputil
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ftputil/file.py

    r1891 r1895  
    1 # Copyright (C) 2003-2018, Stefan Schwarzer <sschwarzer@sschwarzer.net>
     1# Copyright (C) 2003-2020, Stefan Schwarzer <sschwarzer@sschwarzer.net>
    22# and ftputil contributors (see `doc/contributors.txt`)
    33# See the file LICENSE for licensing terms.
     
    4444        errors=None,
    4545        newline=None,
     46        *,
    4647        rest=None,
    4748    ):
  • ftputil/host.py

    r1893 r1895  
    1 # Copyright (C) 2002-2019, Stefan Schwarzer <sschwarzer@sschwarzer.net>
     1# Copyright (C) 2002-2020, Stefan Schwarzer <sschwarzer@sschwarzer.net>
    22# and ftputil contributors (see `doc/contributors.txt`)
    33# See the file LICENSE for licensing terms.
     
    194194        errors=None,
    195195        newline=None,
     196        *,
    196197        rest=None,
    197198    ):
Note: See TracChangeset for help on using the changeset viewer.