On Wednesday January 9, 2008, Kent Johnson wrote:
>James Newton wrote:
>> Hi Python Purists!
>>
>> I want all instances of a given class to share a piece of information,
>> but I want to set that information on the fly. I have found that this
>> works:
>>
>>
James Newton wrote:
> The folder in question contains images for counters for a board game.
> Each player instance will use a separate counter image, but all counter
> images will be chosen from the same folder.
>
> It looks as if the Borg pattern would make all players use the same
> counter imag
Kent Johnson wrote:
>> To give you the context: my application allows you to select a skin
for
>> the user interface. I want to set the access path to the skin folder
as
>> a class variable, so that all instances of that class use images from
>> the appropriate folder. The access path will be re
James Newton wrote:
> Hi Python Purists!
>
> I want all instances of a given class to share a piece of information,
> but I want to set that information on the fly. I have found that this
> works:
>
>
> class Foo(object):
> # class_variable = None # There is no real need to declare this
Hi Python Purists!
I want all instances of a given class to share a piece of information,
but I want to set that information on the fly. I have found that this
works:
class Foo(object):
# class_variable = None # There is no real need to declare this
def __init__(self):