Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #62472
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Subject | Re: sort(*, key=None, reverse=None) |
| Date | 2013-12-21 07:59 +0000 |
| References | <l93f7t$a2$1@ger.gmane.org> <CABicbJ+KhPzuyE9rXQ-6kgtgcDvMtN=X3RrNTp3a3pERrx5CEg@mail.gmail.com> <l93fn7$48i$1@ger.gmane.org> <CAPTjJmoDS+g-6SEKrbfZ0t6H+743OB8qu=V0nfo=u3ore0vhfQ@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4458.1387612806.18130.python-list@python.org> (permalink) |
On 21/12/2013 07:35, Chris Angelico wrote: > On Sat, Dec 21, 2013 at 6:24 PM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote: >> On 21/12/2013 07:20, Devin Jeanpierre wrote: >>> >>> On Fri, Dec 20, 2013 at 11:16 PM, Mark Lawrence <breamoreboy@yahoo.co.uk> >>> wrote: >>>> >>>> The subject refers to the list sort method given here >>>> http://docs.python.org/3/library/stdtypes.html#list. I believe that the >>>> "*," bit is simply a typo, given that the docs also state "sort() accepts >>>> two arguments that can only be passed by keyword". Am I correct? >>> >>> >>> It's good practice in technical writing to repeat yourself: once in >>> the formal spec, and once in plain english. I don't see why this would >>> be a typo. >>> >>> -- Devin >>> >> >> So what is it actually saying? > > def func(x, y, *moreargs, foo, bar): > pass > > Any positional args after x and y will go into moreargs, so foo and > bar have to be specified by keywords. (And are mandatory, since I > didn't default them.) If moreargs isn't given a name, then additional > positional args are forbidden, but the requirements on foo and bar are > the same. > > ChrisA > Thanks, you learn something new every day. Or, at my age, you relearn something you've forgotten :) Now where was I... -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: sort(*, key=None, reverse=None) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-21 07:59 +0000
csiph-web