Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.105 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.79; '*S*': 0.00; 'cc:addr:python-list': 0.11; 'python': 0.11; 'fail,': 0.16; 'rarely': 0.16; 'wraps': 0.16; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'days,': 0.24; 'pointer': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'leave': 0.29; 'generally': 0.29; 'absolute': 0.30; 'message- id:@mail.gmail.com': 0.30; 'went': 0.31; 'view.': 0.31; 'file': 0.32; 'languages': 0.32; 'open': 0.33; 'point.': 0.35; 'received:google.com': 0.35; 'there': 0.35; "didn't": 0.36; 'useful': 0.36; 'step': 0.37; 'being': 0.38; 'initially': 0.38; 'files': 0.38; 'hardware': 0.61; 'entire': 0.61; 'high': 0.63; 'life': 0.66; 'common,': 0.84; 'subject:skip:o 10': 0.84; "they'd": 0.84; '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=7Aw07eGq8Rk2D98+ZXcrhBN7t3HG8IaYKmzRXuqUstI=; b=NSaoQ2yBG/MInJ/C7HHfWS4QDkLYRTJUsUVS+s/BrU57vkVtGqFFA1rka2n3JHl45D jLIx3LCCQF/+9IwA7EVFcXVjISzUWuNLtRNAdTgRuLHkNvA/7AQu1KdWbkg7osbs5/rU +lptnOOEFX4JmRiVyBfSY7JstnfkzJo1MS0YZfCDWE9DwCvY/4zFbngYbWMlE9SUnwtt e0uWFgwYOfYT3xWQXGAGbcv2lU+pK9bnP2GSKpjkq1O6rNb1cuTcUon3b/UVDO6BH/e9 3HbETAwdMV8inDXY7fOc7hc3vzo0I84n3ErzX7Zj0e1meO9FUtwZJwv4tqM+b28xtmvl 2XdA== MIME-Version: 1.0 X-Received: by 10.180.38.48 with SMTP id d16mr883052wik.16.1368155945810; Thu, 09 May 2013 20:19:05 -0700 (PDT) In-Reply-To: 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> Date: Thu, 9 May 2013 20:19:05 -0700 Subject: Re: object.enable() anti-pattern From: Mark Janssen 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368155947 news.xs4all.nl 15959 [2001:888:2000:d::a6]:46023 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45079 > I think where things went pear shaped is when you made the statement: > >>> There is no sensible use-case for creating a file OBJECT unless it >>> initially wraps an open file pointer. > > That's a pretty absolute point of view. Life is rarely so absolute. In the old days, it was useful to have fine-grained control over the file object because you didn't know where it might fail, and the OS didn't necessarily give you give good status codes. So being able to step through the entire process was the job of the progammers. Now, with languages so high like python and hardware so common, it almost is never necessary, so he has some point. A closed file pointer is useful from a OS-progamming point-of-view though because you generally never want to leave files open where they'd block other I/O. -- MarkJ Tacoma, Washington