Clean Singleton Docstrings

Rob Gaddi rgaddi at highlandtechnology.invalid
Fri Jul 8 12:57:36 EDT 2016


Michael Selik wrote:

>
>
>> On Jul 7, 2016, at 7:46 PM, Rob Gaddi <rgaddi at highlandtechnology.invalid> wrote:
>> 
>> I've got a package that contains a global ensmartened dict that allows
>> all the various parts of my program to share state.
>
> The simplest solution would be to use a module as your singleton. For example, "registry.py" would work. Pydoc will show its docstring, and it will have all the features you had been using, with the added benefit of not needing to enforce its singletonness.
>      

REALLY needs to be an object, preferably dict-like.  For instance, one
of the things it does is provide a .getKeyChanged(self, key) method that
returns a keyChanged QSignal so that various elements of the program can
all register for notifications triggered by __setitem__.  That way, when
Registry['dut'] gets updated, all of the various GUI elements reliant on
information about the dut all dump their old data and find out about the
newly connected device.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.



More information about the Python-list mailing list