I have a class (content.MyClass), which stores lots of facts about bacteria. I call it many times, to define many types of bacteria. It isn't highly elegant, but it is reasonably fast, readable, and modular (easy to add more bacteria).
Question: is there a better way I should do this?
import content
def myMethod():
bacteria = {} #A dictionary I fill with 'Bacteria Name':object
bacteria['Staph Aureus'] = content.MyClass(
bug_type = ['gram+'],
virulence = ['Protein A', 'TSST-1', 'exfoiative toxin', 'enterotoxin'],
labs = ['catalase+', 'coagulase+']
)
bacteria['Staph Epidermidis'] = content.MyClass(
bug_type = ['gram+'],
sx = ['infects prosthetic devices']
)
#Etc. about 25 more times.
return bacteria
(Footnote: I know PEP 8 says I should indent everything to line up with "MyClass(", but that wouldn't work here as some of the lists are very long. Also, there are a lot more variables in each class; I trimmed them for the example here.)