File: test_acquisition.py

package info (click to toggle)
python-extclass 1.2-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 432 kB
  • ctags: 547
  • sloc: ansic: 4,549; python: 134; makefile: 46; sh: 18
file content (19 lines) | stat: -rw-r--r-- 288 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from ExtensionClass import Base
import Acquisition

class B(Base):
    color='red'

class A(Acquisition.Implicit):
    def hi(self): print self, self.color

b=B()
b.a=A()
b.a.hi()
b.a.color='green'
b.a.hi()
try:
    A().hi()
    raise 'Program error', 'spam'
except AttributeError: pass