[Ann] managesieve v0.8 released

2024-03-18 Thread Hartmut Goebel via Python-list
Announcing: managesieve 0.8     RFC-5804 Manage Sieve client library for remotely managing Sieve scripts,     including an user application (the interactive 'sieveshell'). :Homepage: https://managesieve.readthedocs.io/ :Author:   Hartmut Goebel :License:   - for the managesieve

Re: Configuring an object via a dictionary

2024-03-18 Thread Anders Munch via Python-list
dn wrote: >Loris Bennett wrote: >> However, with a view to asking forgiveness rather than >> permission, is there some simple way just to assign the dictionary >> elements which do in fact exist to self-variables? > >Assuming config is a dict: > > self.__dict__.update( config ) Here's

Re: Configuring an object via a dictionary

2024-03-18 Thread Tobiah via Python-list
On 3/15/24 02:30, Loris Bennett wrote: Hi, I am initialising an object via the following: def __init__(self, config): self.connection = None self.source_name = config['source_name'] self.server_host = config['server_host'] However, with a view to asking

Re: Configuring an object via a dictionary

2024-03-18 Thread Tobiah via Python-list
I should mention that I wanted to answer your question, but I wouldn't actually do this. I'd rather opt for your self.config = config solution. The config options should have their own namespace. I don't mind at all referencing foo.config['option'], or you could make foo.config an object by

Re: Configuring an object via a dictionary

2024-03-18 Thread Loris Bennett via Python-list
Tobiah writes: > I should mention that I wanted to answer your question, > but I wouldn't actually do this. I'd rather opt for > your self.config = config solution. The config options > should have their own namespace. > > I don't mind at all referencing foo.config['option'], > or you could