ssecorp wrote:
def append(self, item):
self.stack.append(item)
I can get to see the stack with var.stack but then why even implement
append when I could do self.stack.append(x) etc.
That way you could do away with OO completely.
Umm. Even if you were to write that, self and
On Jul 13, 12:32 am, ssecorp [EMAIL PROTECTED] wrote:
I first learned about OO from Java.
I much prefer to program in Python though.
However I am consufed about 2 things.
1. Why do I have to pass self into every method in a class? Since I am
always doing why cant this be automated or
I first learned about OO from Java.
I much prefer to program in Python though.
However I am consufed about 2 things.
1. Why do I have to pass self into every method in a class? Since I am
always doing why cant this be automated or abstracted away?
Are the instances where I won't pass self?
I
On Jul 12, 12:32 pm, ssecorp [EMAIL PROTECTED] wrote:
I first learned about OO from Java.
I much prefer to program in Python though.
However I am consufed about 2 things.
Short answer is, Java isn't the only way OOP.
Longer answers follow.
1. Why do I have to pass self into every method
ssecorp [EMAIL PROTECTED] wrote:
1. Why do I have to pass self into every method in a class? Since I am
always doing why cant this be automated or abstracted away?
Are the instances where I won't pass self?
I imagine there is some tradeoff involved otherwise it would have been
done away
On 12 juil, 18:32, ssecorp [EMAIL PROTECTED] wrote:
I first learned about OO from Java.
I much prefer to program in Python though.
However I am consufed about 2 things.
1. Why do I have to pass self into every method in a class?
You mean declare self as the first argument, I assume ?
This
On Jul 12, 1:01 pm, Duncan Booth [EMAIL PROTECTED] wrote:
ssecorp [EMAIL PROTECTED] wrote:
1. Why do I have to pass self into every method in a class? Since I am
always doing why cant this be automated or abstracted away?
Are the instances where I won't pass self?
I imagine there is some
In article [EMAIL PROTECTED],
Duncan Booth [EMAIL PROTECTED] wrote:
Sadly a lot of Java programmers mistake the limitations of their language
for rules of OO programming, and worse this has spread from Java into other
languages where these restrictions no longer need apply.
You can
On Jul 12, 8:44 pm, castironpi [EMAIL PROTECTED] wrote:
On Jul 12, 1:01 pm, Duncan Booth [EMAIL PROTECTED] wrote:
ssecorp [EMAIL PROTECTED] wrote:
1. Why do I have to pass self into every method in a class? Since I am
always doing why cant this be automated or abstracted away?
Are