Created
April 24, 2012 20:04
-
-
Save mylons/2483189 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Singleton: | |
__single = None | |
def __init__( self ): | |
if Singleton.__single: | |
raise Singleton.__single | |
#this line of code is never reached | |
#if __single already exists | |
Singleton.__single = self |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment