Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74831 > unrolled thread
| Started by | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| First post | 2014-07-19 20:14 +0100 |
| Last post | 2014-07-19 20:14 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: What's the proper style for a library string function? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-19 20:14 +0100
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2014-07-19 20:14 +0100 |
| Subject | Re: What's the proper style for a library string function? |
| Message-ID | <mailman.12059.1405797273.18130.python-list@python.org> |
On 19/07/2014 18:38, C.D. Reimer wrote: > Greetings, > > I typically write a Python 2.7 string function in my library like this: > > def getCompletedTime(start, end): return "Time completed:", str(end > - start) > Further to my earlier post are you aware of the behaviour of your "string function"? >>> def getCompletedTime(start, end): return "Time completed:", str(end - start) ... >>> t = getCompletedTime(0, -1) >>> type(t) <class 'tuple'> >>> t[0] 'Time completed:' >>> t[1] '-1' Is this what you intended? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com
Back to top | Article view | comp.lang.python
csiph-web