suggestions for functional style (singleton pattern?)
yves at zioup.com
yves at zioup.com
Sat Feb 28 23:11:00 EST 2015
On 2015-02-28 19:19, Michael Torrie wrote:
> You say you are trying to use a singleton pattern, but your code does
> not appear to implement a singleton. From what I can read of your code,
I call it a singletone because I only every create one object.
I am not trying to use a singleton, I'm trying to avoid issues created by the
alternative ways of doing this (not having access to the variables in the repl
etc...).
> you really should just put all your functions as methods to the DirStat
> class and call it good. Especially if your module is going to be used
> in several places potentially at the same time.
There are type of problems where I don't want to bind functions to data.
By the way, I have just added some more explanation in the code, trying to
clarify the problem.
--
http://yves.zioup.com
gpg: 4096R/32B0F416
More information about the Python-list
mailing list