#!/usr/bin/env python

"""
CS373: Quiz #35 (5 pts)
"""

""" ----------------------------------------------------------------------
1. What is the output of the following program?
   (4 pts)

1
A.A()
A.A()
False
A.A()
A.f()
2
A.A()
3
True
A.f()
4
5
True
A.f()
6
"""

def Decorator (c) :
    x = c()
    return lambda : x

class A (object) :
    def __init__ (self) :
        print "A.A()"

    def f (self) :
        print "A.f()"

print "1"

print A() is A()
A().f()

print "2"

A = Decorator(A)

print "3"

print A() is A()
A().f()

print "4"

A = Decorator(A)

print "5"

print A() is A()
A().f()

print "6"
