Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder5.xlned.com!news2.euro.net!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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'answering': 0.09; 'instances.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sentence': 0.09; 'gui': 0.12; 'systems.': 0.12; 'descriptors,': 0.16; 'kern': 0.16; 'most)': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'underlying': 0.16; 'so.': 0.16; 'wrote:': 0.18; 'example': 0.22; 'header:User-Agent:1': 0.23; 'frameworks': 0.24; 'interpret': 0.24; 'query': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'robert': 0.30; 'then.': 0.30; 'asked': 0.31; 'context.': 0.31; 'file': 0.32; 'another': 0.32; 'running': 0.33; 'cases': 0.33; 'skip:b 30': 0.33; "i'd": 0.34; 'etc': 0.35; 'there': 0.35; 'curious': 0.36; 'instances': 0.36; 'doing': 0.36; 'should': 0.36; 'button': 0.38; '8bit%:86': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'according': 0.40; 'our': 0.64; 'talking': 0.65; 'world': 0.66; 'believe': 0.68; 'qualified': 0.72; 'eco': 0.84; 'limits,': 0.84; 'subject:skip:o 10': 0.84; 'terrible': 0.84; 'reducing': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robert Kern Subject: Re: object.enable() anti-pattern Date: Fri, 10 May 2013 18:20:34 +0100 References: <518a123c$0$11094$c3e8da3@news.astraweb.com> <518b32ef$0$11120$c3e8da3@news.astraweb.com> <518be931$0$29997$c3e8da3$5496439d@news.astraweb.com> <518c5bbc$0$29997$c3e8da3$5496439d@news.astraweb.com> <518c7f8e$0$29997$c3e8da3$5496439d@news.astraweb.com> <518cd360$0$29997$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 213.1.240.226 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 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: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368206453 news.xs4all.nl 15882 [2001:888:2000:d::a6]:54356 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45117 On 2013-05-10 16:44, Serhiy Storchaka wrote: > 10.05.13 15:19, Robert Kern написав(ла): >> I'd be curious to see in-the-wild instances of the anti-pattern that you >> are talking about, then. > > Many (if not most) GUI frameworks use this pattern. > > button = Button("text") > button.setForegroundColor(...) > button.setBackgoundColor(...) > button.setFont(...) > button.setRelief(...) > button.setBorder(...) > button.setWidth(...) > button.setAction(...) > button.setMouseListener(...) > button.place(...) > > Another example is running a subprocess in Unix-like systems. > > fork() > open/close file descriptors, set limits, etc > exec*() According to Steven's criteria, neither of these are instances of the anti-pattern because there are good reasons they are this way. He is reducing the anti-pattern to just those cases where there is no reason for doing so. That is why I asked for in-the-wild instances. I should have qualified my sentence to include "according to your criteria" because people seem to be answering my query out of that context. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco