As I am making a genetic algorithm, I have a Individu class:
class Individu:
genotype: List[int]
code: List[int]
phenotype: List[List[Client]]
fitness: float
Most of the time only the attribute genotype is used in the program (for crossing over parents or computing the fitness).
Now, instead of always writing p1.genotype[] when I need to use it, could I make Individu iterable so that I can write p1[] instead or is it a bad idea?
I feel like it would make my program cleaner for me but at the same time could be confusing for others or 'break' some kind of programming best practice.