title: Error importing class to another file with python
body: <p>I am learning python at the moment
  the task is this;
  Write a program that reads pet information (name, type and age) from a file (called animals.txt) and creates Pet objects (using the information stored in the animals.txt file).  Store Pet objects in a list called animals.</p>
  
  <p><strong>animal.txt</strong></p>
  
  <pre><code>ralph, dog, 3
  buster, cat, 8
  sammy, bird, 5
  mac, dog, 1
  coco, cat, 6
  </code></pre>
  
  <p>My class file i created is called 
  <strong>pet.py</strong></p>
  
  <pre><code>class Pet:
      # The __init__ method initializes the data attributes of the Profile class
      def __init__(self, name ='', animal_type = '', age = ''):
          self.__name = name
          self.__animal_type = animal_type
          self.age = 0
  
      def __str__(self):
          string = self.__name + ' ' + self.__animal_type + ' ' + self.age
          return string
  
      def set_name(self, name):
          self.__name = name
  
      def get_name(self):
          return self.__name
  
      def set_animal_type(self, breed):
          self.__animal_type = breed
  
      def get_animal_type(self):
          return self.__animal_type
  
      def set_age(self, old):
          self.age = old    
  
      def get_age(self):
          return self.age
  </code></pre>
  
  <p>I then want to use this class in a file 
  <strong>animals.py</strong></p>
  
  <pre><code>import pet
  
  animals = [] // create a list 
  
  infile = open("animals.txt", "r") // open the file
  
  lines = infile.readlines() // read all lines into list
  
  ## add each pet object
  for line in lines:
      data = line.split(",")
      animals.append(pet.set_name(data[0]))
      animals.append(pet.set_animal_type(data[1]))
      animals.append(pet.set_age(data[2]))
  
  infile.close()
  </code></pre>
  
  <p>I am getting an error </p>
  
  <blockquote>
    <p>pet.set_name [pylint] E1101 : module 'pet' has no 'set_name' member.</p>
  </blockquote>
  
  <p>If i do this code below in the class file <strong>pet.py</strong> I don't get the error</p>
  
  <pre><code>pet = Pet()
  name = "thing"
  breed = "dog"
  pet.set_name(name)
  pet.set_animal_type(breed)
  pet.set_age(10)
  print(pet)
  </code></pre>
  
  <p>and it returns as expected</p>
  
  <blockquote>
    <p>thing dog 10</p>
  </blockquote>
  
  <p>Why wont the <strong>animals.py</strong> file allow me to use the class i have imported?</p>
  
  <p>I have tried pet=Pet() but it has </p>
  
  <blockquote>
    <p>error E0602: undefined variable 'Pet'</p>
  </blockquote>