[Tutor] Singletons

Joseph J. Strout joe@strout.net
Fri, 12 Mar 1999 09:10:44 -0800


At 10:16 PM -0800 03/11/99, David Priest wrote:

>def Window():
>	# as above
>def __Window(window):
>	def __init__:
>		# set up window
>
>	def Close(self):
>		# shut down app

>But the singleton pattern for Window() doesn't have a Close() method, of
>course.

Wait... if you've done something like

	myWindow = Window()

then myWindow is an object of class __Window (which is what the Window()
factory function returns, right?).  It has a Close() method.  What's the
problem?

Cheers,
-- Joe
,------------------------------------------------------------------.
|    Joseph J. Strout           Biocomputing -- The Salk Institute |
|    joe@strout.net             http://www.strout.net              |
`------------------------------------------------------------------'