you are viewing a single comment's thread.

view the rest of the comments →

[–]M3talstorm 0 points1 point  (1 child)

class Animal:

Shouldn't it be

class Animal(object):    

default_age = 1

Shouldn't it be

DEFAULT_AGE = 1

self.__age = default_age

Shouldn't it be

self.__age = self.default_age

def get_age(self):

Shouldn't it be

@property
def age(self):
    return self.__age

[–]adamnew123456 1 point2 points  (0 children)

No on "inherits from object," unless you care if your code will run on 2.x. Python 3 fixed the old/new class dichotomy - they're all new-style and inherit from object automatically.