Are these good ideas?

Barry barry at barrys-emacs.org
Mon Nov 14 17:53:14 EST 2022



> On 14 Nov 2022, at 22:49, Chris Angelico <rosuav at gmail.com> wrote:
> 
> On Tue, 15 Nov 2022 at 09:38, Barry <barry at barrys-emacs.org> wrote:
>> 
>> 
>> 
>>>> On 14 Nov 2022, at 22:06, Thomas Passin <list1 at tompassin.net> wrote:
>>> 
>>> For parameter passing like your #2, I have packaged them into a dictionary and passed that around.  It was easy enough, and worked well.
>>> 
>> I used to use a dict but having been burnt with issues now create a class.
>> 
>> With a class you can add accessor methods that allow you to run debug code as values are changed. Also you can check that values being set are spelt correctly, have reasonable values etc.
>> 
> 
> TBH you could add accessor methods to a dict just as easily

Its the dict interface that we found allowed for API abuse and lead to hard to fix bugs.

Barry

> 
> ChrisA
> -- 
> https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list