Marlysson / Algoritmos-Redes

Implementação dos algoritmos de Hamming e CRC na camadas de correção/detecção de erros
2 stars 0 forks source link

Add frame validation at Constructor #4

Open Marlysson opened 8 years ago

Marlysson commented 8 years ago

Using the method .is_valid() at constructor , to that so that building object raise some exception..

class Frame:
    def __init__(self,value):
        if self.is_valid(self):
            raises ValueError("Incorrect Value")
        self.value = value