Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74828

Re: What's the proper style for a library string function?

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 <chris@cdreimer.com>
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" <chris@cdreimer.com>
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> <lqed60$si$1@ger.gmane.org>
In-Reply-To <lqed60$si$1@ger.gmane.org>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12056.1405796016.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: What's the proper style for a library string function? "C.D. Reimer" <chris@cdreimer.com> - 2014-07-19 11:52 -0700

csiph-web