Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Lalancette Newsgroups: comp.lang.python Subject: Re: Looking for ideas to improve library API Date: Thu, 26 Nov 2015 08:35:20 -0500 Lines: 12 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 1+vD9jHzBoE7eduO+33bIwt25MixLeRdCo9ELOB9+aAA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'api': 0.09; 'cc:addr:python-list': 0.09; 'subject:library': 0.09; 'yeah,': 0.09; 'thu,': 0.15; '(other': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:ideas': 0.16; 'wrote:': 0.16; 'ownership': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'thanks,': 0.24; 'header :In-Reply-To:1': 0.24; "i've": 0.25; 'chris': 0.26; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; 'object,': 0.27; 'file': 0.34; 'received:google.com': 0.35; 'nov': 0.35; 'requiring': 0.35; 'but': 0.36; 'should': 0.36; 'instead': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'why': 0.39; '26,': 0.72; 'subject:improve': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VjSZ9sW7WDu3Hs3Nlc97ws/i1zMal/ggTxkvK2Qa7gE=; b=x6bqw9sIIBdpbzRz86Iypxw17dyKbxilE8neuBkMGLTOw29c+5gjBZOMZPrDLdrNsR KVPV1IDF6RfOUc6kL1+kSBWB2dsjkz0ltZfhiHWJEoZWGpYBQdniwCiAhaetTzRHldRW WppJLm4gfz0tqXpRJn0q5rBKrZgzqJgs9kRU1QL3zuSIek4OEAQi5M0ceA2S2EPQCGiO pJe74Ay0UPZcH2Rd9sLjGzqrKmEEeEbt+lLfGQjl/7dWlVGLH/nlUZ+fVpF6FDvbq0Hj uApp3D9XlAYwGicu2ykofvlXQsmY9SG4ilSSZdOYbH/MEpVaq+qCcHKKtjZSkofr6P3M stMg== X-Received: by 10.107.44.210 with SMTP id s201mr49738471ios.62.1448544920913; Thu, 26 Nov 2015 05:35:20 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99575 On Thu, Nov 26, 2015 at 7:46 AM, Devin Jeanpierre wrote: > Why not take ownership of the file object, instead of requiring users > to manage lifetimes? Yeah, I've kind of been coming to this conclusion. So my question then becomes: how do I "take ownership" of it? I already keep a reference to it, but how would I signal to the API user that they should no longer use that file object (other than documentation)? Thanks, Chris