How to access types in python using the name of the type?


#1
# instead of
c3.SmartBulb.fetch()

# do this?
my_type_name = "SmartBulb"
c3[my_type_name].fetch()

#2

getattr(c3, my_type_name).fetch()