Nesting class definitions

Paul Everitt (paul@cminds.com)
Fri, 29 Jul 1994 23:59:05 -0400 (EDT)

Can you nest class definitions? I have a subclass that only needs to be
seen within an instance of the parent class:

class FORM(BaseEntTag):
def __init__(self,owner,action,method,enctype,value):
self.owner=owner
self.action=action
self.method=method
self.enctype=enctype
self.value=value
--etc--
class TEXTAREA:
def __init__(self,value):
self.value=value
def render(self):
print '<TEXTAREA>'+self.value+'</TEXTAREA>'
class --other tags for forms that don't belong anywhere else--

Then, I want to say:
form1=FORM('http://localhost/cgi-bin/foo.py','POST, \
'',[TEXTAREA('Some text'),TEXTAREA('Some text') ])

The point is, those are tags that are meaningful only to the FORM class.
When I make the FORM class definition, with the nested class, the
interpreter allows it. However, when I create the instance above, I get a
NameError for TEXTAREA.

So, where is the TEXTAREA class in the NameSpace, and how could I use it?

TIA.

Paul Everitt V 703.785.7384 Email Paul.Everitt@cminds.com
Connecting Minds, Inc. F 703.785.7385 WWW http://www.cminds.com/