1
I would like to know if the use of **kwargs in a constructor is the best alternative or if there is a better path for similar cases to the one below:
class Duvida(object):
def __init__(self, **kwargs):
self.formato=''
self.nota='5'
if 'formato' in kwargs.keys():
self.formato=kwargs['formato']
if 'nota' in kwargs.keys():
self.nota=kwargs['nota']
q=Duvida(formato='Formato Personalizado')
No, yeah Explicit is Better than implicit. If you want to receive parameters in the constructor, specify them.
– Woss