Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: lambdak: multi-line lambda implementation in native Python Date: Sat, 17 Jan 2015 10:29:47 +1300 Lines: 39 Message-ID: References: <3d8068b3-7b63-43c0-bbf2-6111b2c73aa4@googlegroups.com> <87zj9kb2j0.fsf@elektro.pacujo.net> <54B86CF8.7040602@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net WvgCtuABcDpBSvlRLsjJYAEvEusGBO6k+dlK7q9pjTPr6W8vMS Cancel-Lock: sha1:aSCQoy8p5paZpl9+h9Nfx1wDgRA= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: Xref: csiph.com comp.lang.python:83901 Chris Angelico wrote: > Is this to get > around style guides that reject this kind of model: > > x = Foo( > opt1=True, > opt2=True, > color=Yellow, > ) It's to get around the fact that you *can't* do that in Java, because it doesn't have keyword arguments. This is a source of a lot of the complexity and boilerplate found in Java code -- the need to work around deficencies in the language. > But if you can > pass a mapping object to the constructor, you can do the same job that > way, Yes, but constructing the mapping object is just as tedious. :-( > you could pass an array of > item,value,item,value,item,value or something. That's certainly possible, but then you have to write tedious code in the constructor to parse the arguments, you lose compile-time type safety, incur runtime overhead, etc. We're really quite spoiled in Python-land. It's easy to forget just *how* spoiled we are until you go back and try to do something in one of the more primitive languages... -- Greg