Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Michael Selik Newsgroups: comp.lang.python Subject: Re: How much sanity checking is required for function inputs? Date: Sun, 24 Apr 2016 01:21:24 +0000 Lines: 16 Message-ID: References: <5713E52D.3060407@icloud.com> <1461131475.4042173.584042297.03DAB00E@webmail.messagingengine.com> <57171D23.40709@stoneleaf.us> <1461133057.4046578.584060569.2DD34821@webmail.messagingengine.com> <57185E88.30201@yahoo.com> <57197FC3.4030701@icloud.com> <1461291613.433097.586174185.01BB7E37@webmail.messagingengine.com> <57199BA5.4000703@icloud.com> <5719ACBB.8020905@stoneleaf.us> <571C1AA8.8000202@icloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de YZi+NJRAXJBH4/ndfHk33wiTUaotwKTTGhegx0mLOZRw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:How': 0.09; 'constants.': 0.09; 'enum': 0.09; 'ide': 0.09; 'oh,': 0.09; 'suggestions.': 0.09; 'python': 0.10; '2016': 0.16; '23,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'recently.': 0.16; 'subject:required': 0.16; 'wrote:': 0.16; '>': 0.18; 'to:2**1': 0.21; 'for?': 0.23; 'forgot': 0.23; 'sat,': 0.23; "haven't": 0.24; 'header:In-Reply-To:1': 0.24; 'mostly': 0.27; 'message- id:@mail.gmail.com': 0.27; 'str': 0.29; "i'd": 0.31; 'certain': 0.31; 'int': 0.33; 'received:google.com': 0.35; 'replace': 0.35; 'supports': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'totally': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'to:addr:python.org': 0.40; 'your': 0.60; 'avoid': 0.61; 'hmm...': 0.84; 'ethan': 0.91; 'furman': 0.91; 'look.': 0.91; 'subject:much': 0.91; 'mistakes': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=sdkNmam7sXWMWhAk7IYgdjNaBCgEwSv1J9KSxOokCiA=; b=qslIQMFsUODJhsgo+FlVJcJ4Gh3Obb/vK/oUn+N+74dJldWubJOe71UMqH/HOKQ5T8 oieUe+2bx5nfkU9+/+R5cePq488P5obYmh9u21M0iLPgIT3zG5+7yrrY6IG8UfCNAhAs fDtEphDVhJ9ukR4amKhtdPEIp+ocvYYJBEQAJEZW9BfaXEPAQ39RY0Rb9HfQM9NEwBkq LJjIk9xcoa4HesYVDI37lQ3otMLZj+eJesUJZ52gHm4NIKYFLraF3PYRr3lMnxANy64n d82lQqsrshAKXusBv1hKjTs7hLud4W2OxW+6g7hRbnTVv1MDYYYy7X60VBlncPxF2gAx h2Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=sdkNmam7sXWMWhAk7IYgdjNaBCgEwSv1J9KSxOokCiA=; b=fzct+xKgSRSJIYL0RTNHxwbOcbCQlxEQ9TqjLCpEf60VVXfc8CSkXVaKFNsaPkFXy9 960CcSpQRc8RqIIO4/3QsmCeo4jXfChhkPxZhIo/MzDO2ng6FK8P2pg5qH0D3ateJHTp zzMHdiUVxmOzB6diyxQSfdxomB7mMuQYu7CWHoEBe9nNhslkvSPE2udVraLmWD5iDJhF f40z+G0x+jRSeymcDY3gfm3/3luWi2CEP7QWFdDD0w6b0RqHe9G25UOHyuSvYViZfVM3 udG7ZNhyV1ekE5FcMT8jh2yM0xstRnd5cYiT6ojlgUe0Z6tTdyeL6gQgSKfKVdFc0MR6 F2DA== X-Gm-Message-State: AOPr4FVZdENRUDSves1oRsa5lBxkaGAf+ovSFm40LxPjehfoPMBOlYvdvxsKPG5bxcdsa007k0LpY4c9GznZhw== X-Received: by 10.141.3.66 with SMTP id f63mr12785644qhd.55.1461460894663; Sat, 23 Apr 2016 18:21:34 -0700 (PDT) In-Reply-To: <571C1AA8.8000202@icloud.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <5713E52D.3060407@icloud.com> <1461131475.4042173.584042297.03DAB00E@webmail.messagingengine.com> <57171D23.40709@stoneleaf.us> <1461133057.4046578.584060569.2DD34821@webmail.messagingengine.com> <57185E88.30201@yahoo.com> <57197FC3.4030701@icloud.com> <1461291613.433097.586174185.01BB7E37@webmail.messagingengine.com> <57199BA5.4000703@icloud.com> <5719ACBB.8020905@stoneleaf.us> <571C1AA8.8000202@icloud.com> Xref: csiph.com comp.lang.python:107523 On Sat, Apr 23, 2016 at 9:01 PM Christopher Reimer < christopher_reimer@icloud.com> wrote: > On 4/21/2016 9:46 PM, Ethan Furman wrote: > > Oh! and Enum!!! ;) > > OMG! I totally forgot about Enum. Oh, look. Python supports Enum. Now I > don't have to roll my own! > > Hmm... What do we use Enum for? :) > You can use Enum in certain circumstances to replace int or str constants. It can help avoid mistyping mistakes and might help your IDE give auto-complete suggestions. I haven't found a good use for them myself, but I'd been mostly stuck in Python 2 until recently.