No Do while/repeat until looping construct in python?

Kim Petersen kp at kyborg.dk
Tue Mar 18 07:29:05 EST 2003


William Sonna wrote:
> On Thu, 13 Mar 2003 09:27:07 -0600, sismex0 wrote:
> [snip a lot]
 >

> On the other hand, if you have a valid reason why "self" is advantageous
> FROM THE USER's POINT OF VIEW I would like to hear it.
>
hmmm

lets take this definition:

def fun(x,y):
    i:=3
    while x<y:
      i,x=i+1,x+1
    return i

if (according to your definition) i wrote this outside of a class - it 
would make `i' a local variable in fun's namespace - if i wrote the same
inside a class - then it would automagically be converted into the 
class'es namespace??? Then how do i differentiate between class 
variables and local variables - introduce a local <var> keyword similar 
to the global (and if only active in class scope then break the fact 
that functions work the same outside and inside)? no thanks .... more 
work and less productivity for me.

And secondly - how do i call a class function - a function which cannot 
be identified by the calling object? eg: base.method() where my object 
is not derived from base but is mutable into the object (deliberatly 
(eg. by design) - call it an interface or whatever...)

oh - and all this is in the FAQ....


> I already know that:
> 
> a. "its already been talked to death! see html://blahblahblah"
> b. "real Python programmers KNOW why"
> c. "use (c++|Java|Perl|$your_pick) instead"
> d. Python RULEZZZ
> e. Please don't question the language or post critiques - somebody might agree
>    with you!!
> 
> So you can skip those (or cut and paste, if you prefer).
> 
> [snip]



-- 
Med Venlig Hilsen / Regards

Kim Petersen - Kyborg A/S
IT - Innovationshuset
Havnepladsen 2
7100 Vejle
Tlf. +4576408183 || Fax. +4576408188





More information about the Python-list mailing list