Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.038 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'lawrence': 0.09; 'statements': 0.09; 'subject:string': 0.09; 'wrote': 0.14; "wouldn't": 0.14; 'subject:library': 0.16; 'wrote:': 0.18; 'first.': 0.19; 'written': 0.21; 'header:User-Agent:1': 0.23; 'from:addr:chris': 0.24; 'received:comcast.net': 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'am,': 0.29; 'besides': 0.30; "i'm": 0.30; 'code': 0.31; 'probably': 0.32; 'third': 0.33; 'subject:the': 0.34; 'something': 0.35; 'definition': 0.35; 'version': 0.36; 'really': 0.36; 'returning': 0.36; 'doing': 0.36; "didn't": 0.36; 'subject:?': 0.36; 'version,': 0.38; 'to:addr:python-list': 0.38; "couldn't": 0.39; 'to:addr:python.org': 0.39; 'simple': 0.61; 'book,': 0.68; 'line,': 0.68; 'received:199': 0.74; 'horrible': 0.84 Date: Sat, 19 Jul 2014 11:52:49 -0700 From: "C.D. Reimer" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: What's the proper style for a library string function? References: <53CAAD27.9010207@cdreimer.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1405796017 news.xs4all.nl 2950 [2001:888:2000:d::a6]:59416 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74828 On 7/19/2014 11:24 AM, Mark Lawrence wrote: > Besides that I wouldn't write the function on one line, the first. I've seen code samples for simple functions with the definition and return statements written on one line. > Once you return your data you can do what you want with it. Returning data from a function is probably the part I'm overlooking. > The third is really horrible in my book, YMMV. That if/else version was something I've been thinking about doing and didn't it put it together until I wrote my email. If I couldn't write a better version, I wouldn't keep it myself. Chris Reimer