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


Groups > comp.lang.python > #91237

Re: Documentaion of dunder methods

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Documentaion of dunder methods
Date 2015-05-26 08:24 +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>
Newsgroups comp.lang.python
Message-ID <mailman.50.1432625102.5151.python-list@python.org> (permalink)

Show all headers | 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