Comment voir si quelque chose est dans une classe à Python

#Python
#This is just some code I thought of to add things from a list 
#to a file while the list contains items with classes where an
#attrubute is "name"
class stuffs:
  def __init__(self,name,other_random_stuff):
    self.name  = name
    self.stuff = other_random_stuff
thing = stuffs("Insert name here",10)
list = ["Some string",10,thing]
file = open("demofile.txt","a")
for item in list:
  try:
    try:
      print("Adding "+str(item.name))
      file.write(str(item.name)+"""
""")
    except:
      print("Adding "+str(item))
      file.write(str(item)+"""
""")
  except:
    print("Sorry, an error occured. Please try again."
file.close()
Brave Boar