Re: Finding the instance reference of an object

2008-10-27 Thread Dale Roberts
On Oct 17, 5:39 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 17, 2008, at 3:19 PM, Grant Edwards wrote: > > >> And my real point is that this is exactly the same as in every > >> other modern language. > > > No, it isn't. In many other languages (C, Pascal, etc.), a > > "variable" is commonl

Re: Finding the instance reference of an object

2008-10-27 Thread Dale Roberts
[I am actually enjoying this discussion, even though it does not address the OP's question. It is helping to solidify *my* understanding.] Joe Strout wrote: On Oct 27, 2008, at 12:19 PM, [EMAIL PROTECTED] wrote: I think this "uncontrived" example addresses the C/Python difference fairly direc

Re: Finding the instance reference of an object

2008-10-28 Thread Dale Roberts
On Oct 28, 2:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 28 Oct 2008 01:16:04 -0200, Dale Roberts <[EMAIL PROTECTED]>   > escribió: > > > > > So, then, what to tell a C++ programmer about how Python passes   > > arguments?

Re: Finding the instance reference of an object

2008-10-28 Thread Dale Roberts
On Oct 28, 11:59 am, Joe Strout <[EMAIL PROTECTED]> wrote: > ... > > There are only the two cases, which Greg quite succinctly and   > accurately described above.  One is by value, the other is by   > reference.  Python quite clearly uses by value.  Parameters are   > expressions that are evaluated

Re: Finding the instance reference of an object

2008-10-29 Thread Dale Roberts
On Oct 28, 11:59 am, Joe Strout <[EMAIL PROTECTED]> wrote: > ... > > There are only the two cases, which Greg quite succinctly and   > accurately described above.  One is by value, the other is by   > reference.  Python quite clearly uses by value.  Parameters are   > expressions that are evaluated

Re: Finding the instance reference of an object

2008-10-30 Thread Dale Roberts
On Oct 29, 9:13 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Oct 29, 2008, at 4:52 PM, Fuzzyman wrote: > > > You're pretty straightforwardly wrong. In Python the 'value' of a > > variable is not the reference itself. > > That's the misconception that is leading some folks around here into   > tan

Re: Finding the instance reference of an object

2008-10-30 Thread Dale Roberts
On Oct 30, 11:03 am, Joe Strout <[EMAIL PROTECTED]> wrote: > ... >> Are you saying that C++ is capable of using the Call By Reference idiom, >> but C is not, because C does not have a reference designation for formal >> function parameters? > > It's been a LONG time since I did anything in C, but y

Re: Finding the instance reference of an object

2008-10-30 Thread Dale Roberts
On Oct 30, 3:06 pm, Dale Roberts <[EMAIL PROTECTED]> wrote: > ... that idiom deserves a different name which > distinguishes it from the commonly accepted notion of Pass By Value. Bah, what I meant to end with was: Just as the Pass By Reference idiom deserves a unique name to disting

Re: Finding the instance reference of an object

2008-10-31 Thread Dale Roberts
On Oct 31, 3:15 am, greg <[EMAIL PROTECTED]> wrote: > Dale Roberts wrote: > > Just as the Pass By Reference idiom deserves a unique name to > > distinguish it from Pass By Value (even though it is often Pass By > > (address) Value internally), so Pass By Object Reference

Re: Finding the instance reference of an object

2008-10-31 Thread Dale Roberts
On Oct 31, 2:27 am, greg <[EMAIL PROTECTED]> wrote: > Dale Roberts wrote: > > Are you > > saying that C++ is capable of using the Call By Reference idiom, but C > > is not, because C does not have a reference designation for formal > > function parameters? >

Re: any(), all() and empty iterable

2009-04-16 Thread Dale Roberts
On Apr 14, 8:33 am, Tim Chase wrote: > ... > I still prefer "Return False if any element of the iterable is > not true" or "Return False if any element in the iterable is > false" because that describes exactly what the algorithm does. I agree that the original doc comment is not helpful as it st

Re: any(), all() and empty iterable

2009-04-16 Thread Dale Roberts
On Apr 16, 2:27 pm, Tim Chase wrote: > Raymond Hettinger wrote: > > I will not change the sentence to "return false if any element > > of the iterable is false."  The negations make the sentence > > hard to parse mentally > > Just as a ribbing, that "return X if any element of the iterable > is X"

send() to a generator in a "for" loop with continue(val)??

2009-04-17 Thread Dale Roberts
I've started using generators for some "real" work (love them!), and I need to use send() to send values back into the yield inside the generator. When I want to use the generator, though, I have to essentially duplicate the machinery of a "for" loop, because the "for" loop does not have a mechanis

Re: send() to a generator in a "for" loop with continue(val)??

2009-04-19 Thread Dale Roberts
On Apr 17, 10:07 pm, Aaron Brady wrote: > You can do it with a wrapping generator.  I'm not sure if it > interferes with your needs.  It calls 'next' the first time, then just > calls 'send' on the parameter with the value you send it. Aaron, Thanks for the hint. I'd made a modified version of m

Re: send() to a generator in a "for" loop with continue(val)??

2009-04-19 Thread Dale Roberts
On Apr 19, 6:10 am, Peter Otten <__pete...@web.de> wrote: > ... > I only just started reading Beazley's presentation, it looks interesting. > Thanks for the hint! > > Are you currently using coroutines in Python? If so, what kind of practical > problems do they simplify for you? I thought I'd chim