Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Does': 0.04; 'instance': 0.05; 'operator': 0.05; 'compares': 0.09; 'none:': 0.09; 'undefined.': 0.09; 'am,': 0.13; 'received:209.85.214.174': 0.13; 'received:mail-iw0-f174.google.com': 0.13; 'subject:file': 0.13; 'wrote:': 0.15; 'false),': 0.16; 'def': 0.16; 'compared': 0.22; 'header:In-Reply-To:1': 0.22; 'received:209.85.214': 0.28; 'code,': 0.29; 'subject:support': 0.30; 'separate': 0.31; 'subject:?': 0.31; 'andrew': 0.32; 'pointing': 0.32; 'message- id:@gmail.com': 0.32; "what's": 0.33; 'to:addr:python-list': 0.34; 'header:User-Agent:1': 0.34; '...': 0.34; "can't": 0.34; 'none': 0.35; "isn't": 0.35; 'received:192': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'received:192.168.1': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; 'exact': 0.69; 'subject:mode': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=rDEWO9TQbrwEjWoCtyUfINGPfICyNmd/URRAf50FfHQ=; b=AWgWajzmWQT+1zLITQx4mv8D+oxuwoIjsh5KHTcw0Qxmf18M2Hr7O0XYNuduCzP84h fmn5th3A+k+b9UrNvvBKqwmjY4qxa9xnrbZrJQ5fcqZKAKMHhbEtH04xlfwfvPwEE4t+ K8Vl2pwpHhLTE2Machbw+DUxreqEDodE5Nmw0= Date: Thu, 07 Jul 2011 08:58:48 -0500 From: Andrew Berg User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: "comp.lang.python" Subject: Re: Does hashlib support a file mode? References: <0c058f60-3fd7-4b67-85a2-0658b2bb1887@glegroupsg2000goo.googlegroups.com> <9e976158-94c7-4e8b-8aa8-f0daa644b06d@fv14g2000vbb.googlegroups.com> <4e14ecd4$0$29965$c3e8da3$5496439d@news.astraweb.com> <0cd66788-5603-421e-82fb-fa3ac089711c@u42g2000yqm.googlegroups.com> <6218f9fc-2155-4f31-aa07-fe2caadac190@y30g2000yqb.googlegroups.com> In-Reply-To: <6218f9fc-2155-4f31-aa07-fe2caadac190@y30g2000yqb.googlegroups.com> X-Enigmail-Version: 1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310047140 news.xs4all.nl 21884 [2001:888:2000:d::a6]:35834 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9031 On 2011.07.07 08:39 AM, Phlip wrote: > On Jul 7, 6:24 am, Andrew Berg wrote: > > On 2011.07.07 08:11 AM, Phlip wrote:> No, I was pointing out that passing a type is more ... typesafe. > > > > None is a type. > > I never said it wasn't. You are talking about this code, right? def file_to_hash(path, m=None): if m is None: m = hashlib.md5() What's not a type? The is operator compares types (m's value isn't the only thing compared here; even an separate instance of the exact same type would make it return False), and m can't be undefined.