Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'operator': 0.03; 'interpreter': 0.05; 'subject:Python': 0.06; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'mind.': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'yourself.': 0.31; 'subject: (': 0.35; "can't": 0.35; 'method': 0.36; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'manually': 0.60; 'new': 0.61; 'simple': 0.61; 'such': 0.63; 'situation': 0.65; 'within': 0.65; 'subject:! ': 0.74; 'received:12': 0.81; 'answer:': 0.84; 'subject:!)': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Emile van Sebille Subject: Re: dunder-docs (was Python is DOOMED! Again!) Date: Sun, 01 Feb 2015 12:51:58 -0800 References: <54c07d04$0$13012$c3e8da3$5496439d@news.astraweb.com> <54c1ccc8$0$13005$c3e8da3$5496439d@news.astraweb.com> <54c6d7c2$0$12992$c3e8da3$5496439d@news.astraweb.com> <54c83ab4$0$12982$c3e8da3$5496439d@news.astraweb.com> <54ca583e$0$13005$c3e8da3$5496439d@news.astraweb.com> <54ccc2fc$0$13009$c3e8da3$5496439d@news.astraweb.com> <54cd9a7a$0$12984$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: www.westernstatesglass.com User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422823936 news.xs4all.nl 2935 [2001:888:2000:d::a6]:58559 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85029 On 2/1/2015 12:45 PM, Chris Angelico wrote: > Simple answer: You write dunder methods and the interpreter calls > them. You don't call them yourself. > > I can't currently think of any situation where it's appropriate to > call a dunder method manually (cue the swamping of such situations on > the list); you just call dir() or the + operator or whatever it be. calling the parent dunder method from within the overiding new method comes to mind. Emile