Configuring an object via a dictionary

Mats Wichmann mats at wichmann.us
Fri Mar 15 14:35:26 EDT 2024


On 3/15/24 03:30, Loris Bennett via Python-list wrote:
> Hi,
> 
> I am initialising an object via the following:

>          self.source_name = config['source_name']

config.get('source_name', default_if_not_defined)  is a common technique...






More information about the Python-list mailing list