Re: one to many (passing variables)

2014-07-30 Thread Antoon Pardon
On 30-07-14 13:37, Peter Otten wrote: > Antoon Pardon wrote: > >> Taking this in consideration I think the io.RawIOBase.read got it >> backwards. >> >> The documentation says the following: >> >> | If 0 bytes are returned, and size was not 0, this indicates end of file. >> | If the object is in no

Re: one to many (passing variables)

2014-07-30 Thread Peter Otten
Antoon Pardon wrote: > Taking this in consideration I think the io.RawIOBase.read got it > backwards. > > The documentation says the following: > > | If 0 bytes are returned, and size was not 0, this indicates end of file. > | If the object is in non-blocking mode and no bytes are available, Non

Re: one to many (passing variables)

2014-07-30 Thread Antoon Pardon
On 28-07-14 21:29, Terry Reedy wrote: > On 7/25/2014 9:47 PM, C.D. Reimer wrote: >> On 7/24/2014 2:58 AM, Ben Finney wrote: >>> Here is an article on good API design; the principles apply to Python >>> http://blog.isnotworking.com/2007/05/api-design-guidelines.html>. >>> You know your API and its

Re: one to many (passing variables)

2014-07-28 Thread CHIN Dihedral
On Tuesday, July 29, 2014 3:29:04 AM UTC+8, Terry Reedy wrote: > On 7/25/2014 9:47 PM, C.D. Reimer wrote: > > > > > > On 7/24/2014 2:58 AM, Ben Finney wrote: > > >> Here is an article on good API design; the principles apply to Python > > >> http://blog.isnotworking.com/2007/05/api-design-guide

Re: one to many (passing variables)

2014-07-28 Thread Terry Reedy
On 7/25/2014 9:47 PM, C.D. Reimer wrote: On 7/24/2014 2:58 AM, Ben Finney wrote: Here is an article on good API design; the principles apply to Python http://blog.isnotworking.com/2007/05/api-design-guidelines.html>. You know your API and its requirements better than we; see whether that sheds

Re: one to many (passing variables)

2014-07-28 Thread Neil D. Cerutti
On 7/25/2014 9:47 PM, C.D. Reimer wrote: Thank you for the link. I'm curious about one item mentioned in the article: "Avoid return values that Demand Exceptional Processing: return zero-length array or empty collection, not null" Isn't a zero-length array, empty collection and null all the same

Re: one to many (passing variables)

2014-07-25 Thread Steven D'Aprano
On Fri, 25 Jul 2014 18:47:55 -0700, C.D. Reimer wrote: > On 7/24/2014 2:58 AM, Ben Finney wrote: >> Here is an article on good API design; the principles apply to Python >> http://blog.isnotworking.com/2007/05/api-design-guidelines.html>. >> You know your API and its requirements better than we; s

Re: one to many (passing variables)

2014-07-25 Thread Chris Angelico
On Sat, Jul 26, 2014 at 11:47 AM, C.D. Reimer wrote: > Isn't a zero-length array, empty collection and null all the same thing? Definitely not. In C++ and Java, which he's primarily looking at, there's a definite difference in usage, and potentially in memory usage/performance. > Or does the "De

Re: one to many (passing variables)

2014-07-25 Thread C.D. Reimer
On 7/24/2014 2:58 AM, Ben Finney wrote: Here is an article on good API design; the principles apply to Python http://blog.isnotworking.com/2007/05/api-design-guidelines.html>. You know your API and its requirements better than we; see whether that sheds any light on improvements to make. Thank y

Re: one to many (passing variables)

2014-07-24 Thread Ben Finney
Martin S writes: > I have functions A B and C. If data generated in A is useable in both > B and C how do I ensure this data is passed as needed? Or is it a > symptom of bad code? This is very vague; an accurate answer is “it depends”. You seem to be asking about how to design your data structu

Re: one to many (passing variables)

2014-07-24 Thread Steven D'Aprano
On Thu, 24 Jul 2014 09:27:10 +0200, Martin S wrote: > Function A collects data and then calls function B with some, but also > has data that should be passed to function C. It might help if you give a bit more information. How does it collect data, how does it decide which bits of information sh

Re: one to many (passing variables)

2014-07-24 Thread Chris Angelico
On Thu, Jul 24, 2014 at 5:27 PM, Martin S wrote: > Function A collects data and then calls function B with some, but also has > data that should be passed to function C. > > But ofc if nested functions are allowed then that might solve the issue. I > don't think I've seen nested functions mentione

Re: one to many (passing variables)

2014-07-24 Thread Martin S
Function A collects data and then calls function B with some, but also has data that should be passed to function C. But ofc if nested functions are allowed then that might solve the issue. I don't think I've seen nested functions mentioned in a tutorial I've been looking at. /martin s On 2

Re: one to many (passing variables)

2014-07-24 Thread Chris Angelico
On Thu, Jul 24, 2014 at 4:36 PM, Martin S wrote: > How do you pass data from one function to many? > > I have functions A B and C. If data generated in A is useable in both > B and C how do I ensure this data is passed as needed? Or is it a > symptom of bad code? This is a little vague. Is there

one to many (passing variables)

2014-07-24 Thread Martin S
My coding is slowly (*) progress at the moment. Looking at my more or less horrible efforts so far one (well that's understatement) questions pops up. How do you pass data from one function to many? I have functions A B and C. If data generated in A is useable in both B and C how do I ensure this