Skip to content

Instantly share code, notes, and snippets.

@jspeis
Created May 26, 2009 04:55
Show Gist options
  • Save jspeis/117898 to your computer and use it in GitHub Desktop.
Save jspeis/117898 to your computer and use it in GitHub Desktop.
import random
class A(object):
def __init__(self):
self.x = random.randint(0,100000)
def f(self):
return A()
def __str__(self):
return str(self.x)
a = A()
b = a.f()
print a,b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment