'@'.join([..join(['fred','dixon']),..join(['gmail','com'])]) a écrit :
noob warning:
what is so wonderful about the NEW class over the old ?
A whole lot of things. But the main thing to know is that old-style
classes are deprecated, and will disappear in the future.
--
http://mail.python.org/mailm
Tian a écrit :
I googled about how to write singleton in python, but even if I use
Singleton, in which module's namespace should I keep the instance of
this singleton?
You found the doc but I'm afraid you did not grasp the concept.
You don't have to 'keep the instance' anywhere - it's the job of t
Tian wrote:
> I have tried using "sysctx=None" instead of "global sysctx", but it
> doesn't work either.
> It seems my initialization work in the previous calling of init() has
> no persistent effect when "utils" is imported using "from
> myproj.utils import getContext".
>
> What's weird, when a mo
"Tian" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I want to create a object directory called Context in my program, which
> is based on a dict to save and retrieve values/objects by string-type
I suspect that you would accomplish your goal much more easily by calling
your modu
noob warning:
what is so wonderful about the NEW class over the old ?
--
http://mail.python.org/mailman/listinfo/python-list
I googled about how to write singleton in python, but even if I use
Singleton, in which module's namespace should I keep the instance of
this singleton? suppose I have a singleton class definiton in
"utils.py", how should I import and where should I make instance and
initialize? Thanks!!
--
http:
Tian a écrit :
I want to create a object directory called Context in my program, which
is based on a dict to save and retrieve values/objects by string-type
name. I have the definition like this:
utils.py
global sysctx
class Context:
def __init__(self):
def set(self, na
I have tried using "sysctx=None" instead of "global sysctx", but it
doesn't work either.
It seems my initialization work in the previous calling of init() has
no persistent effect when "utils" is imported using "from myproj.utils
import getContext".
What's weird, when a module is in the same direc
Le 29 Mar 2005 09:50:46 -0800, Tian a écrit :
> I want to create a object directory called Context in my program, which
> is based on a dict to save and retrieve values/objects by string-type
> name. I have the definition like this:
>
> utils.py
>
> global sysctx
# you are in
I want to create a object directory called Context in my program, which
is based on a dict to save and retrieve values/objects by string-type
name. I have the definition like this:
utils.py
global sysctx
class Context:
def __init__(self):
def set(self, name, obj, over
10 matches
Mail list logo