suggestions for functional style (singleton pattern?)
Mario Figueiredo
marfig at gmail.com
Mon Mar 2 05:31:12 EST 2015
On Mon, 02 Mar 2015 11:19:06 +0100, Fabien <fabien.maussion at gmail.com>
wrote:
>On 01.03.2015 06:05, Michael Torrie wrote:
>> A module*is* a singleton pattern, particularly one
>> that maintains state. I use sometimes use this feature for sharing
>> config and other data between other modules (global state when it's
>> required).
>
>I do this too, after some helping recommendations I got from this
>discussion group. I find it neat to use a module for sharing config
>states, but I always wondered: does this pattern fall into the "globals
>are devil" category?
>
Global constants are conceptually different than global variables. It
is just that in Python there is no semantic diference between the two.
The former are OK and a useful pattern, whereas the latter are the
ones we call evil.
More information about the Python-list
mailing list