Re: Unification of Methods and Functions
From: Greg Ewing (greg_at_cosc.canterbury.ac.nz)
Date: 05/07/04
- Next message: David M. Cooke: "Re: MySQL vrs SQLite"
- Previous message: asdf sdf: "Re: Newbie : Greek letters"
- In reply to: David MacQuigg: "Re: Unification of Methods and Functions"
- Next in thread: David MacQuigg: "Re: Unification of Methods and Functions"
- Reply: David MacQuigg: "Re: Unification of Methods and Functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 07 May 2004 15:59:20 +1200
David MacQuigg wrote:
> Static methods
> are necessary because it is a very natural thing to write a method in
> a class that needs to work without being bound to any particular
> instance.
I beg to differ. It might seem natural to someone who's
been exposed to C++ or Java, but I don't think it's
a priori a natural thing at all.
In Python, a function defined inside a class is a method.
If you want a function to be a method, you put it inside
a class. If you don't want it to be a method, you don't
put it inside a class. It's as simple as that.
-- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg
- Next message: David M. Cooke: "Re: MySQL vrs SQLite"
- Previous message: asdf sdf: "Re: Newbie : Greek letters"
- In reply to: David MacQuigg: "Re: Unification of Methods and Functions"
- Next in thread: David MacQuigg: "Re: Unification of Methods and Functions"
- Reply: David MacQuigg: "Re: Unification of Methods and Functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|