All pastes #2046499 Raw Edit

Unnamed

public text v1 · immutable
#2046499 ·published 2011-04-14 18:41 UTC
rendered paste body
#!/usr/bin/python

class FooBar:
  def __init__(self):
    self.x = 1
  def a(self):
    if self.x < 5:
      self.x += 1
      return "hello"
    else:
      def newa(self):
        return "world"
      self.a = newa
      self.a(self)

f = FooBar()
for x in range(1,8):
  print(f.a())