Thanks for the great feedback! I was missing the whole "methods that share the same data" aspect of a class.. Thats makes them MUCH more clear to understand. Thanks for both of you having the patience to help me figure this out =D Time for me to ditch the classes from my
pyForge.py!On 11/11/06, Al
Chris,
>I guess I'm just lost as to the point of classes... Outside of using
>them to
> abstract a collection of methods that have similair roles
Most people get hung up on the data aspect of classes
and forget that the behaviour(the methods) are actually
the most important bit. However you have
Chris Hengge wrote:
> I guess I'm just lost as to the point of classes... Outside of using
> them to abstract a collection of methods that have similair roles I
> dont see the point.. But when I group similar methods together
> (promptForge is a bad example, but I've got class fileForge which ha
I guess I'm just lost as to the point of classes... Outside of using them to abstract a collection of methods that have similair roles I dont see the point.. But when I group similar methods together (promptForge is a bad example, but I've got class fileForge which has a few file writing or reading
Chris,
>pyForge.promptForge.prompt()
> TypeError: unbound method prompt() must be called with promptForge
> instance
> as first argument (got nothing instead)
>
> ^ Thats why... I have to use :
> import pyForge
> pyForge.promptForge().prompt()
I think the real issue that Luke was raising was
Oops... should have said this... pyForge.promptForge.prompt()TypeError: unbound method prompt() must be called with promptForge instance as first argument (got nothing instead)
^ Thats why... I have to use :import pyForgepyForge.promptForge().prompt()On 11/11/06, Chris Hengge <
[EMAIL PROTECTED]
>So why did you use two sets of parenthesis here?>Are you completely sure you understand everything that's happening here? pyForge.promptForge.prompt()TypeError: unbound method prompt() must be called with promptForge instance as first argument (got nothing instead)
^ Thats why... I have to use
Chris Hengge wrote:
> As for saving memory.. I'm not particularily concerned since all my
> systems have 2gb...
> Also, before python I was writing C# database front ends (nothing
> amazing) and I'm not even going to compare python's 10mb overhead to
> .net's 45mb+. I was mostly just curious if
Chris Hengge wrote:
> is the following dummycode good practice? Or pythonic? or what? I'm
> just curious because there are several ways I've found to use
> libraries and classes...
>
> Method 1:
> from lib import class
> lib().class(param1, param2)
I don't know what you're doing here but I think