Re: [Tutor] OOP clarification needed

2010-06-03 Thread Lie Ryan
On 06/03/10 01:37, Jim Byrnes wrote: > >>> some older procedural languages I always end up becoming confused by >>> the large number of built in methods. >> >> C is one of the simplest procedural languages around >> and yet it comes with a huge library of functions (several >> hundred in some case

Re: [Tutor] OOP clarification needed

2010-06-02 Thread Jim Byrnes
Steven D'Aprano wrote: Case in point is this code snippet from a chapter on Tkinter. def viewer(imgdir, kind=Toplevel, cols=None): """ make thumb links window for an image directory: one thumb button per image; use kind=Tk to show in main app window, or Frame container

Re: [Tutor] OOP clarification needed

2010-06-02 Thread Jim Byrnes
Alan Gauld wrote: "Jim Byrnes" wrote Whenever I teach myself a new language I have great difficulty understanding the nuts and bolts of it's OO implementation. Do you understand the OO concepts OK? Is it only the language semantics you struggle with or the underlying OO concepts? I believe

Re: [Tutor] OOP clarification needed

2010-06-02 Thread Jim Byrnes
Steve Willoughby wrote: On Tue, Jun 01, 2010 at 03:19:17PM -0500, Jim Byrnes wrote: def viewer(imgdir, kind=Toplevel, cols=None): win = kind() What is the relationship between kind=Toplevel in the first line and win=kind() further down. Isn't "kind" a variable and "kind()" a method? kin

Re: [Tutor] OOP clarification needed

2010-06-01 Thread Steven D'Aprano
On Wed, 2 Jun 2010 06:19:17 am Jim Byrnes wrote: > Whenever I teach myself a new language I have great difficulty > understanding the nuts and bolts of it's OO implementation. Compared > to some older procedural languages I always end up becoming confused > by the large number of built in methods.

Re: [Tutor] OOP clarification needed

2010-06-01 Thread Alan Gauld
"Jim Byrnes" wrote Whenever I teach myself a new language I have great difficulty understanding the nuts and bolts of it's OO implementation. Do you understand the OO concepts OK? Is it only the language semantics you struggle with or the underlying OO concepts? some older procedural languag

Re: [Tutor] OOP clarification needed

2010-06-01 Thread Steve Willoughby
On Tue, Jun 01, 2010 at 03:19:17PM -0500, Jim Byrnes wrote: > def viewer(imgdir, kind=Toplevel, cols=None): > win = kind() > > What is the relationship between kind=Toplevel in the first line and > win=kind() further down. Isn't "kind" a variable and "kind()" a method? kind is a variable.