Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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; 'subject:Python': 0.06; 'defaults': 0.07; 'arguments,': 0.09; 'constructor': 0.09; 'python': 0.11; 'jan': 0.12; '"well,': 0.16; 'builders': 0.16; 'optional': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'thu,': 0.19; 'issue.': 0.22; 'separate': 0.22; 'builder': 0.24; 'java': 0.24; '15,': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'went': 0.31; 'layer': 0.31; 'subject:skip:i 10': 0.31; 'another': 0.32; "can't": 0.35; 'problem.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'combination': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'solve': 0.60; 'first': 0.61; '2015': 0.84; '9:00': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=iiPN3XcbV7VmbTO3sCSN3Vn+GfWlHNqXf6UrM95d/oQ=; b=v6+qL5THszr5ED7qtsUFu0awXLGzMssk9T96IA7ovFTLlIhKS7BO7J0bgD3W7eqrI/ Z/845kHld13tvOHewLV+yS/ZZvxnjqG66uC33Q1eZe26f7csLP2LjP9tn3PUb+2v5OK3 7r2ikR0PU62rurl1OSo8gh+jCxZpQXQQspIypR5zyBrdLlcmnS1lbu5/O8xrcjiTFVjF ffyIj1J647y/xpfr8EpOBugl7lUSHGqqffqF+rqrAByKqa7N5rcYxH6pbqVgZu0GhO8y RPiDVm2Z6Zjy5pivlvXYyA2cqh1UrS+Ro/VGMvzqDtOW9xRf92x9sG/I1nyW1ZmI5hq3 YVXQ== X-Received: by 10.66.148.73 with SMTP id tq9mr19972819pab.22.1421386201346; Thu, 15 Jan 2015 21:30:01 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <3d8068b3-7b63-43c0-bbf2-6111b2c73aa4@googlegroups.com> <87zj9kb2j0.fsf@elektro.pacujo.net> <54B86CF8.7040602@gmail.com> From: Ian Kelly Date: Thu, 15 Jan 2015 22:29:21 -0700 Subject: Re: lambdak: multi-line lambda implementation in native Python To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1421386636 news.xs4all.nl 2889 [2001:888:2000:d::a6]:41590 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83867 On Thu, Jan 15, 2015 at 9:00 PM, Chris Angelico wrote: > My first response was going to be "Well, you can always add another > layer of indirection to try to solve your problem", but then I went > and looked up builders on Wikipedia. Now I'm confused. What can you do > with a builder that you can't do with a constructor? In Java you have to write a separate constructor for every conceivable combination of arguments. If there are a lot of optional arguments, that's an exponentially large number of constructors. The builder pattern provides a solution to that problem. In Python you just have one initializer with defaults for the optional arguments, so it's not an issue.