Overriding __dict__() on python class

No. __dict__ is a method used for introspection – it returns object attributes. What you want is a brand new method, call it as_dict, for example – that’s the convention. The thing to understand here is that dict objects don’t need to be necessarily created with dict constructor.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)