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:33:46 -0500 Lines: 10 Message-ID: References: <5656FCC5.9000308@mrabarnett.plus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Sz5/FY/xTKEN3+mmw900fQmS+gpmRIyTx+QBz/iAl+vA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'heavily': 0.04; 'modified': 0.05; 'mrab': 0.05; 'feature.': 0.07; 'objects,': 0.07; 'tests,': 0.07; 'cc:addr:python-list': 0.09; 'descriptor': 0.09; 'file-like': 0.09; 'subject:library': 0.09; 'thu,': 0.15; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:ideas': 0.16; 'wrote:': 0.16; 'instance,': 0.18; 'tests': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'pass': 0.22; 'cc:no real name:2**0': 0.22; 'am,': 0.23; 'header :In-Reply-To:1': 0.24; 'chris': 0.26; 'message- id:@mail.gmail.com': 0.27; 'said,': 0.27; 'this.': 0.28; '(my': 0.29; 'file': 0.34; 'add': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'nov': 0.35; 'unit': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'thought': 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=ddXWR6A3qvGZdBU1jx5nkK5CPWXeHCxDEbOE+KXnuy0=; b=N1IrzbHUasjIudz+r3qXxl/i43jS979STQFh6AfNnOG9Jw+OlB4jP5FEDdjjtAZSEs iN1QRxFKv1VuwQoarZzWuy1BleDMW60pMxB+DuJwDdsrNTGGqXClv4Yzjcd78b58DIjC YkKmOQi2H1n5Q3ILcBppUetMClp8ScWTv+X8SqDCr2fiDsIIYyvA+HhnCBR+NKZhePs7 r2iUai0gT/0c6e3qoq5ufwqc9lLvd65IBITAjXuxCtp/KXikGaVL1MC5nwO/NdCZ0Pfg LNqYnVnRN/26/lHYZDY0ofMyQJQkIVLwuUb6erGcPIGjhIiwQpgkV1GRZBbJXit2ajsu Y3NQ== X-Received: by 10.107.10.199 with SMTP id 68mr39551966iok.75.1448544827032; Thu, 26 Nov 2015 05:33:47 -0800 (PST) In-Reply-To: <5656FCC5.9000308@mrabarnett.plus.com> 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:99573 On Thu, Nov 26, 2015 at 7:36 AM, MRAB wrote: > Why pass a file descriptor? Why not a filename? The reason for a file descriptor is so that I can also add other file-like objects, such as StringIO. My unit tests, for instance, rely heavily on this. That being said, it is not *strictly* required (my unit tests could be modified to write to temporary files), but I thought it was a nice feature. Chris