Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.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.034 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.01; 'enabling': 0.05; 'python:': 0.09; 'cc:addr:python-list': 0.11; 'distinct': 0.16; 'ought': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'point': 0.28; 'message-id:@mail.gmail.com': 0.30; 'received:google.com': 0.35; 'really': 0.36; 'should': 0.36; 'example,': 0.37; 'resource': 0.38; 'though,': 0.39; 'avoid.': 0.84; 'subject:skip:o 10': 0.84; 'received:mail- wi0-x229.google.com': 0.91; 'washington': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=p2vw/uYjwadoElMptgFPoLytfTTTnBZSQXrr1MNIfjI=; b=QmQHMV8h0qD5IcGevko09WJa50bo6c6+LRr5iaW1bCTr2zA2wd2/UAprLhqpVJoc62 QmLj2OjYpFdpcAjX8fhBv1ZCqKLE8+kv4WGmcnMpDWiyZxRrcBGMLbgOXGozy5C/7Eqa g4R+bFaMTHHQGVxKWJIgt04vMFxjaLalORgl89uk7vRLUOJqu9ccvP8san8z72tYT+m8 kmIsCtidzZ3QrSQ98x3hxQ1EZK1Mvi0bVk9XSvDe1fn2X4aC2JCTnHvrU8c2VbBWwnd/ ioMSZuZq/pwdmNbu10kNLaQx0Ht+3qlsKZ+izDBv4HbvFZYhS0P9VBM02YiQybBks3Wi XMCA== MIME-Version: 1.0 X-Received: by 10.194.248.200 with SMTP id yo8mr14680077wjc.36.1368068162778; Wed, 08 May 2013 19:56:02 -0700 (PDT) In-Reply-To: References: <518a123c$0$11094$c3e8da3@news.astraweb.com> Date: Wed, 8 May 2013 19:56:02 -0700 Subject: Re: object.enable() anti-pattern From: Mark Janssen To: "Steven D'Aprano" Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368068164 news.xs4all.nl 15868 [2001:888:2000:d::a6]:34695 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44995 >> This is an anti-pattern to avoid. The idea is that creating a resource >> ought to be the same as "turning it on", or enabling it, or similar. For >> example, we don't do this in Python: > > I would call it "user-mediated resource allocation" as distinct from > "object-mediated" resource allocation. I should point out, though, it's not really an anti-pattern (coming form the C community). -- MarkJ Tacoma, Washington