[Tutor] Using class methods

Alan Gauld alan.gauld at btinternet.com
Tue Jun 21 19:35:56 CEST 2011


"Christopher King" <g.nius.ck at gmail.com> wrote

> class Farm_class(object):
...
> or if you want to use a method of the Critter class within the farm 
> do
>
> class Farm_class(object):

But please do NOT add '_class' to the end of your class names!
The fact that it has a capital letter at the front combined with 
context
should be enough of a clue. Otherwise we'll all wind up doing things
like:

x_int = 2
y_int = 4
answer_string = str(x_int+y_int)

Eek, please, no! :-)

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list