2 ms·
First impression: get_field_name and set_field_name seem quite verbose when one could simply get / set attributes directly
by airstrike 7y ago
First impression: get_field_name and set_field_name seem quite verbose when one could simply get / set attributes directly
- orf 7y agoYeah, this could be more pythonic for sure. Setter and getter methods are always a bit iffy in Python, usually their presence in a library doesn’t bode well. They could make some of them work with the same syntax as dictionaries, which would be a good start.
- zbentley 7y ago> usually their presence in a library doesn’t bode well Yuuup. My personal favorite is SendGrid/Twilio's email envelope handling, in which the way you add multiple headers is by .... assigning to an attribute multiple times: mail_object.header = "header 1" mail_object.header = "header 2" mail_object.send() # Sends with headers ["header 1", "header 2"]