Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #76282
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Subject | Re: what is the "/" mean in __init__(self, /, *args, **kwargs) ? |
| Date | 2014-08-14 09:41 +0100 |
| References | <53EC1887.6060205@gmail.com> <85iolv7rhr.fsf@benfinney.id.au> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.12983.1408005684.18130.python-list@python.org> (permalink) |
On 14/08/2014 03:08, Ben Finney wrote: > luofeiyu <elearn2014@gmail.com> writes: > >>>>> help(int.__init__) >> Help on wrapper_descriptor: >> >> __init__(self, /, *args, **kwargs) >> Initialize self. See help(type(self)) for accurate signature. >> >> what is the "/" mean in __init__(self, /, *args, **kwargs) ? > > I don't know, I haven't seen that before. It is confusing. > > At least it is acknowledged (“See [elsewhere] for accurate signature”) > to be unhelpful. > > I suspect this is an artefact of the impedance mismatch between Python > function signatures and the implementation of ‘int’ in C code. The “/” > may be a placeholder for something the C implementation requires but > that Python's function signature expectation doesn't allow. > > Perhaps Python 3's keyword-only arguments may one day help functions > like that get implemented with a more useful signature, but I'm not > holding my breath for that. > Something to do with the Argement Clinic http://legacy.python.org/dev/peps/pep-0436/ ??? -- 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: what is the "/" mean in __init__(self, /, *args, **kwargs) ? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-14 09:41 +0100
csiph-web