Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'defaults': 0.05; 'default.': 0.07; 'imply': 0.07; '"if': 0.09; 'received:internal': 0.09; 'wed,': 0.15; 'explicitly': 0.15; '(either': 0.16; 'downside': 0.16; 'ellipsis': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'parameter,': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'sentinel': 0.16; 'subject: \n ': 0.16; 'subject:?)': 0.16; 'wrote:': 0.16; 'runs': 0.18; 'provided,': 0.22; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'parameters': 0.27; 'objects': 0.29; 'code': 0.31; 'to:addr :python-list': 0.35; "isn't": 0.35; 'received:10': 0.37; 'subject:: ': 0.37; 'signature': 0.37; 'received:66': 0.38; 'mean': 0.38; 'to:addr:python.org': 0.39; 'subject: (': 0.40; 'subject:the': 0.40; 'behavior': 0.61; 'from:no real name:2**0': 0.61; 'providing': 0.61; 'show': 0.62; 'header:Message-Id:1': 0.62; 'risk': 0.67; 'unusual': 0.72; 'aiui': 0.84; 'subject:Set': 0.91 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=cXJ1a/eWDLhz7oH3KD74jrMhYxk=; b=iCbPwA BEyL8CS4msA+Wehgiav0hrHMoK5ahqEj19QvuN5KuTn7XdvoZHdpHI7tXVk1B2av +BrI3vLGGHrs1+4OPluB9ud98Rf7aL5WT0nKQnX4EYb6xamNC59hTAJtZtVkXkqN HddDdpOPLFeQrqNCj5xhQrrRt18cxryxv9els= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=cXJ1a/eWDLhz7oH 3KD74jrMhYxk=; b=Jn+d+ymrnkM3QRlIopMca5DGqEt2AEwZ4vSX2WLLUh09cBy Vkn8Fn9Dpe++MgG3hgNQl+Xc69bNZzPb+g5v3D9gLUIgaFLwL79cLqmO+Ef5Wk8Q KeGvLbVicMTfd7tac53aZna+FujquYeKCx8X6eKt2t9PH+fNg+/RVOdOMaWQ= X-Sasl-Enc: a09WlnWaCkffRqTsdXIg2WLaRAM3c9+7o1GjhP1HLqJb 1434631032 From: random832@fastmail.us To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-32536285 Subject: Re: Documenting a function signature (was: Set a flag on the function or a global?) Date: Thu, 18 Jun 2015 08:37:12 -0400 In-Reply-To: References: <557fdbd6$0$11097$c3e8da3@news.astraweb.com> <55818b3c$0$1665$c3e8da3$5496439d@news.astraweb.com> <55819878$0$1658$c3e8da3$5496439d@news.astraweb.com> <85egl9ubj5.fsf_-_@benfinney.id.au> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 1434631036 news.xs4all.nl 2939 [2001:888:2000:d::a6]:56646 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92826 On Wed, Jun 17, 2015, at 20:14, Chris Angelico wrote: > Mostly. That would imply that object is a mandatory parameter, which > AIUI isn't the case for Steven's edir. The downside of this kind of > signature is that it's hard to show the parameters that have unusual > defaults (either sentinel objects and custom code to cope, or they're > pulled out of *a or **kw). My instinct would be to put =... for that case and explain in the documentation "If foo is not provided, [behavior]". Of course, that runs the risk of people thinking you actually mean Ellipsis, or that providing Ellipsis explicitly will give the same behavior as the default.