Sujet : Re: Which code style do you prefer the most?
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 02. Mar 2025, 23:13:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vq2l61$v1q6$14@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Pan/0.162 (Pokrosvk)
On Sun, 2 Mar 2025 11:31:48 +0000, bart wrote:
Does it have optional arguments with default values? IMO keyword
arguments are much less useful without that feature/
The two do seem to go together. ;)
Python has long had the feature of, not only *allowing* arguments to be
specified by keyword, but *requiring* them to be passed that way, for all
arguments after a specified point in the argument list.
Newer versions even go a step further, some might say in the backwards
direction, by *requiring* arguments prior to a specified point to be
passed by position only, not keyword.
Of course, all this ties in to the great flexibility you have with dealing
in argument lists in Python, allowing not just for the caller to pass
arbitrary numbers of arguments, but also use arbitrary names for them.