Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76282

Re: what is the "/" mean in __init__(self, /, *args, **kwargs) ?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'initialize': 0.07; '*args,': 0.09; 'arguments': 0.09; 'expectation': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'language.': 0.14; '"/"': 0.16; '**kwargs)': 0.16; 'before.': 0.16; 'finney': 0.16; 'placeholder': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'url:peps': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; "python's": 0.19; 'header :User-Agent:1': 0.23; 'url:dev': 0.24; "haven't": 0.24; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; "doesn't": 0.30; '???': 0.30; "i'm": 0.30; 'that.': 0.31; 'subject:what': 0.31; 'writes:': 0.31; 'url:python': 0.33; 'implemented': 0.33; 'skip:_ 10': 0.34; 'subject:the': 0.34; 'something': 0.35; 'but': 0.35; 'useful': 0.36; 'url:org': 0.36; 'ben': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'our': 0.64; 'more': 0.64; 'holding': 0.65; 'between': 0.67; 'day': 0.76; 'received:2': 0.84; 'subject:self': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: what is the "/" mean in __init__(self, /, *args, **kwargs) ?
Date Thu, 14 Aug 2014 09:41:05 +0100
References <53EC1887.6060205@gmail.com> <85iolv7rhr.fsf@benfinney.id.au>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host host-2-98-207-127.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0
In-Reply-To <85iolv7rhr.fsf@benfinney.id.au>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12983.1408005684.18130.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408005684 news.xs4all.nl 2841 [2001:888:2000:d::a6]:47019
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76282

Show key headers only | View raw


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


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