A Single Instance of an Object?

Chris Angelico rosuav at gmail.com
Mon Mar 11 17:45:10 EDT 2024


On Tue, 12 Mar 2024 at 08:04, Ivan "Rambius" Ivanov
<rambiusparkisanius at gmail.com> wrote:
> > A Singleton is just a global variable. Why do this? Did someone tell
> > you "global variables are bad, don't use them"?
>
> I have bad experience with global variables because it is hard to
> track what and when modifies them. I don't consider them bad, but if I
> can I avoid them.
>
If you have a singleton, how will you track "what and when modifies"
it? How is it any different from a global?

ChrisA


More information about the Python-list mailing list