Are these good ideas?

Chris Angelico rosuav at gmail.com
Mon Nov 14 17:46:00 EST 2022


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

ChrisA


More information about the Python-list mailing list