Re: static object

2007-01-04 Thread Bruno Desthuilliers
Ben Finney a écrit : (snip) The Singleton pattern does what you say here. Implementing a proper Singleton in Python is complicated and hard to understand. Really ? Using __new__ and a class attribute, it doesn't seem so complicated - nor difficult to understand... --

static object

2007-01-03 Thread meelab
Dear All, I am looking for a way to create a static object or a static class - terms might be inappropriate - having for instance: class StaticClass: . . and then staticObject1 = StaticClass() staticObject2 = StaticClass() so that staticObject1 and staticObject2 refers exactly

Re: static object

2007-01-03 Thread bearophileHUGS
That looks like some kind of singleton. Why don't you use a module instead of a class? Another solution is to define your data as class attributes. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: static object

2007-01-03 Thread Thomas Ploch
meelab schrieb: Dear All, I am looking for a way to create a static object or a static class - terms might be inappropriate - having for instance: class StaticClass: . . and then staticObject1 = StaticClass() staticObject2 = StaticClass() so that staticObject1

Re: static object

2007-01-03 Thread Russell Owen
In article [EMAIL PROTECTED], meelab [EMAIL PROTECTED] wrote: Dear All, I am looking for a way to create a static object or a static class - terms might be inappropriate - having for instance: class StaticClass: . . and then staticObject1 = StaticClass() staticObject2

Re: static object

2007-01-03 Thread Gabriel Genellina
At Wednesday 3/1/2007 19:38, meelab wrote: I am looking for a way to create a static object or a static class - terms might be inappropriate - having for instance: class StaticClass: . . and then staticObject1 = StaticClass() staticObject2 = StaticClass() so that staticObject1

Re: static object

2007-01-03 Thread Felipe Almeida Lessa
On 1/3/07, meelab [EMAIL PROTECTED] wrote: I am looking for a way to create a static object or a static class - terms might be inappropriate - having for instance: An example will speak better than me: class Card(object): __cards = {} def __init__(self, number, suit

Re: static object

2007-01-03 Thread Ben Finney
meelab [EMAIL PROTECTED] writes: In other words, that is a class which would result in only 1 instance always the same no matter how many times I will instantiate it. The Singleton pattern does what you say here. Implementing a proper Singleton in Python is complicated and hard to understand.

[ python-Bugs-1280924 ] PyDateTime_Check references static object

2005-09-02 Thread SourceForge.net
thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: None Status: Closed Resolution: Invalid Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Nobody/Anonymous (nobody) Summary: PyDateTime_Check references static