Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.134.4.91.MISMATCH!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.044 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'exists.': 0.07; 'f.close()': 0.09; 'implements': 0.09; 'cc:addr:python-list': 0.11; "wouldn't": 0.14; 'roy': 0.16; 'why,': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'command': 0.22; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'unix': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'open': 0.33; 'something': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'example,': 0.37; 'sometimes': 0.38; 'sure': 0.39; 'is.': 0.60; 'name': 0.63; 'smith': 0.68; 'touch': 0.74; 'article': 0.77; 'oscar': 0.84; 'subject:skip:o 10': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=cc6zZmpRukDRpmNE21Sm3GV0elfEot1DX4Too/KONXE=; b=thvacvOmAv7I9vkYDEXKgaJex2GceSH6DNiadvedHCkD4nBST/+Cft4c2x/ZLlzSmQ UD5kqL2J9aslnHFqGZ4/N/FmJL5SWVRHvx8vJfMTMB+S4AfuJL3vwbC+JCTV1LXUfuwo VGLaAbESATnNMpRDlmF0tIzKYlNUyaBb8Hyi+z4Iw/I7j4y9R2dhY2U083ClF9IQYb63 +0OXf4Dj4xzAqSfyGfMceuQtwQm9iBkIRvhtiPxsPQmeULddFKAjydZ1D6SBVmy94DZj GRQQwjFzzjxRHvTx73NFJlBGMhieGka6P9CP5nWcfKTfo/5fDOP8MHPgmoIZFj8S+A9W qy7w== X-Received: by 10.220.78.131 with SMTP id l3mr7955527vck.54.1368107496628; Thu, 09 May 2013 06:51:36 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <518a123c$0$11094$c3e8da3@news.astraweb.com> <518b32ef$0$11120$c3e8da3@news.astraweb.com> From: Oscar Benjamin Date: Thu, 9 May 2013 14:51:16 +0100 Subject: Re: object.enable() anti-pattern To: Roy Smith 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368107499 news.xs4all.nl 15942 [2001:888:2000:d::a6]:54825 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45034 On 9 May 2013 14:07, Roy Smith wrote: > In article <518b32ef$0$11120$c3e8da3@news.astraweb.com>, > Steven D'Aprano wrote: > >> There is no sensible use-case for creating a file without opening it. > > Sure there is. Sometimes just creating the name in the file system is > all you want to do. That's why, for example, the unix "touch" command > exists. Wouldn't the code that implements the touch command just look something like this: f = open(filename) f.close() Or is there some other way of creating the file that doesn't open it (I mean in general not just in Python)? Oscar