Re:Using attrs for everything in Python
by BerislavLopac on Sunday August 28, 2016 @11:12AM
(#12376813)
> I wonder why you need to supply a dictionary to the object instead of keyword pairs.
My understanding is that the main reason is to make constructors more flexible, with arguments like _raw_data_, _trusted_data_ etc. But it is trivial to write a simple helper function that would accept keyword pairs and build a model instance.
My understanding is that the main reason is to make constructors more flexible, with arguments like _raw_data_, _trusted_data_ etc. But it is trivial to write a simple helper function that would accept keyword pairs and build a model instance.