Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: Fear and suspicion of lambdas, was Re: Meta decorator with parameters, defined in explicit functions Date: Sat, 02 Jul 2016 18:00:47 +1000 Lines: 35 Message-ID: References: <85mvm5vrbw.fsf@benfinney.id.au> <0690f476-95ad-4dec-87e5-42ecee07fdcd@googlegroups.com> <87poqx96ul.fsf@handshake.de> <87bn2h85rn.fsf@bsb.me.uk> <8537nsvmbc.fsf@benfinney.id.au> <87fursil2y.fsf@handshake.de> <85mvm0wjtc.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de bD/kqHl2Iun4bwZzsaEV2wPUv0zyp9R2BGX9wJdg4kQg== Cancel-Lock: sha1:dMC1GuzfrX+V1fbxZdiuNVFnt1w= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'purpose.': 0.07; 'it;': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'clear.': 0.16; 'docstring': 0.16; 'naming': 0.16; 'operation.': 0.16; 'parts,': 0.16; 'rather,': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:parameters': 0.16; 'success)': 0.16; 'thread.': 0.16; 'nested': 0.18; 'transform': 0.18; 'decorator': 0.22; 'function,': 0.22; 'tried': 0.24; "i've": 0.25; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'header:X -Complaints-To:1': 0.26; 'function': 0.28; 'motivation': 0.29; 'that.': 0.30; 'code': 0.30; 'anyone': 0.32; 'message.': 0.33; 'previous': 0.34; 'on,': 0.35; 'clear': 0.35; 'but': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'signature': 0.37; 'front': 0.38; 'brief': 0.38; 'names': 0.38; 'to:addr:python.org': 0.40; 'subject:with': 0.40; 'your': 0.60; 'hope': 0.61; 'address': 0.61; 'making': 0.62; 'elsewhere': 0.66; 'natural': 0.67; 'reply,': 0.72; 'presented': 0.72; 'obvious': 0.76; '(apparently': 0.84; '_o__)': 0.84; 'received:125': 0.84; 'thing,': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) 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: <85mvm0wjtc.fsf@benfinney.id.au> X-Mailman-Original-References: <85mvm5vrbw.fsf@benfinney.id.au> <0690f476-95ad-4dec-87e5-42ecee07fdcd@googlegroups.com> <87poqx96ul.fsf@handshake.de> <87bn2h85rn.fsf@bsb.me.uk> <8537nsvmbc.fsf@benfinney.id.au> <87fursil2y.fsf@handshake.de> Xref: csiph.com comp.lang.python:110950 dieter writes: > Ben Finney writes: > > ... Rather, the motivation was that a complex thing, with many > > moving parts, has an unexplained implementation: a nested set of > > functions without names to explain their part in the pattern. > > In a previous reply, I have tried to explain (apparently without > success) that the "thing" is not "complex" at all Your explanation was clear. I disagree with it; the code is not at all obvious in its intention or operation. Naming the parts descriptively, and writing a brief synopsis docstring for each function, is a way to address that. Which is my motivation for this thread. > but a simple signature transform for a decorator definitition You're making my case for me: To anyone who doesn't already know exactly what's going on, that is not at all obvious from the code as presented in the first message. > and that the nested function implementation is natural for this > purpose. The nested function implementation is not the problem, as I hope I've made clear elsewhere in this thread. -- \ “People's Front To Reunite Gondwanaland: Stop the Laurasian | `\ Separatist Movement!” —wiredog, http://kuro5hin.org/ | _o__) | Ben Finney