makinacorpus / easydict

Access dict values as attributes (works recursively)
GNU Lesser General Public License v3.0
294 stars 47 forks source link

Add support for default value for non-existent keys access #19

Closed Rogersjk closed 4 years ago

Rogersjk commented 4 years ago

Sometimes, I want to feed some parameters in functions like params.epochs, But it will come accross a error if epochs is not explicitly defined in my configuration file. The default_value can help to handle the conditions.