Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'ugly': 0.07; 'python': 0.08; 'myself,': 0.09; 'programmer': 0.10; 'argument': 0.15; '(eg': 0.16; 'bounds': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'justify': 0.16; 'subject:?)': 0.16; 'subject:Java': 0.16; 'wrote:': 0.16; 'arguments': 0.18; 'figure': 0.21; 'header:In-Reply-To:1': 0.22; 'optional': 0.23; 'pm,': 0.24; 'aug': 0.24; 'posted': 0.26; 'message- id:@mail.gmail.com': 0.29; 'specified': 0.31; 'does': 0.32; 'actually': 0.33; 'there': 0.33; 'to:addr:python-list': 0.33; 'fri,': 0.36; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'suggestions': 0.39; 'either': 0.39; 'meaning': 0.39; 'to:addr:python.org': 0.39; 'sense': 0.39; "it's": 0.40; '100%': 0.82; 'flexibility,': 0.84; 'cope': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=FUwI1IEd8o6t9YTZ4a/jtX6wziKpQwCjidkFsVduXiA=; b=hWFOr+OIA4MpOhTKs6BT8RuuJkQ1dL/011/h3w6kOGr8DNQO9oMRzDH17ijvFp5CtV Sae5CaCOHNCFhvWhccxKz5iQ+SNc6uDYqetOsutqPjhL3rKXfAN7IPqUiaBYpy6js6x8 /MIwMH5qEzya5qU1xqn8aK2/gMxQcfafQ3YqA= MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 12 Aug 2011 21:39:33 +0100 Subject: Re: Java is killing me! (AKA: Java for Pythonheads?) From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313181576 news.xs4all.nl 23932 [2001:888:2000:d::a6]:49662 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11306 On Fri, Aug 12, 2011 at 6:02 PM, kj wrote: > I ask myself, how does the journeyman Python programmer cope with > such nonsense? > Firstly, figure out how many combinations of optional arguments actually make sense. Any that don't, don't support. That may well cut it down significantly. And then, if there are any that make sense but will be really rare (eg if you allow optional specification of a max and a min, and most times you'll use either both bounds or neither), you can save a few by having the "optional" argument specified with a sentinel meaning "default". It's ugly in a few places to justify simplicity in most. If you really need 100% flexibility, then the suggestions already posted will definitely be the best. ChrisA