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


Groups > comp.lang.python > #91237

Re: Documentaion of dunder methods

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2a.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.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'from:addr:yahoo.co.uk': 0.05; 'interpreter.': 0.07; 'patch.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'bug': 0.10; 'python': 0.11; 'convey': 0.16; 'helpers': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.16; 'documented': 0.18; 'language': 0.19; '>>>': 0.20; 'tracker': 0.20; 'lawrence': 0.22; 'pass': 0.22; '2015': 0.23; 'module': 0.23; 'header:In-Reply-To:1': 0.24; 'raise': 0.24; 'developers': 0.24; 'header:User-Agent:1': 0.26; 'header:X -Complaints-To:1': 0.26; '(e.g.': 0.27; "doesn't": 0.28; 'methods.': 0.29; 'protocols': 0.29; 'guess': 0.29; 'that.': 0.30; 'core': 0.32; 'language.': 0.32; "d'aprano": 0.33; 'instead,': 0.33; 'steven': 0.33; 'to:addr:python-list': 0.35; 'acceptable': 0.35; 'possible,': 0.35; 'protocol': 0.35; 'but': 0.36; 'possible.': 0.36; 'should': 0.37; 'subject:: ': 0.37; 'tue,': 0.38; 'received:org': 0.38; 'pm,': 0.39; 'to:addr:python.org': 0.39; 'mark': 0.40; 'some': 0.40; 'easy': 0.60; 'course': 0.64; 'our': 0.64; 'charset:windows-1252': 0.65; '26,': 0.72; 'directly.': 0.76; 'lack': 0.76; 'received:89': 0.80; 'pythonistas,': 0.84; 'utc+5:30,': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Documentaion of dunder methods
Date Tue, 26 May 2015 08:24:38 +0100
References <5563d7bb$0$12982$c3e8da3$5496439d@news.astraweb.com> <5563e5e8$0$12983$c3e8da3$5496439d@news.astraweb.com> <0c3aeb41-aaf9-4453-9ccc-b2c8891f1394@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-89-240-166-61.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
In-Reply-To <0c3aeb41-aaf9-4453-9ccc-b2c8891f1394@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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.50.1432625102.5151.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1432625102 news.xs4all.nl 2958 [2001:888:2000:d::a6]:45113
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:91237

Show key headers only | View raw


On 26/05/2015 04:30, Rustom Mody wrote:
> On Tuesday, May 26, 2015 at 8:48:11 AM UTC+5:30, Steven D'Aprano wrote:
>> On Tue, 26 May 2015 12:17 pm, Steven D'Aprano wrote:
>>
>>> In other words, dunder methods are reserved for use by the core developers
>>> for the use of the Python interpreter.
>>
>> Er, that's easy to misinterpret. Let me try rewording:
>>
>> You should not invent new dunder methods.
>>
>> And if possible, you should not call such dunder methods directly. Instead,
>> use the official protocol (e.g. next(x), not x.__next__()) whenever
>> possible. The operator module contains many helpers for that.
>>
>> But of course you may *write* dunder methods.
>
> I guess you and I know what we want to convey and to proscribe.
> However the above doesn't pass muster as documentation
> The most glaring lack in the docs is some reification of the acceptable
> 'protocols'.
> Yeah people like to wax about duck-typing but that translates into semi-formal
> protocols and they are just not documented
>

All you need do is raise an issue on the bug tracker with an attached patch.

-- 
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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Documentaion of dunder methods Steven D'Aprano <steve@pearwood.info> - 2015-05-26 12:17 +1000
  Re: Documentaion of dunder methods Rustom Mody <rustompmody@gmail.com> - 2015-05-25 19:36 -0700
  Re: Documentaion of dunder methods Steven D'Aprano <steve@pearwood.info> - 2015-05-26 13:17 +1000
    Re: Documentaion of dunder methods Rustom Mody <rustompmody@gmail.com> - 2015-05-25 20:30 -0700
      Re: Documentaion of dunder methods Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-26 08:24 +0100
  Re: Documentaion of dunder methods Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-25 22:34 -0600
    Re: Documentaion of dunder methods Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-26 17:12 +1000

csiph-web