How to get value of parent class

Joe Mason joe at notcharles.ca
Mon Apr 12 10:58:46 EDT 2004


In article <c5e5fb$irm$1 at newshispeed.ch>, Jean-Pierre Bergamin wrote:
> Hello
> 
> I have the following class structure:
> 
> 
> class MyServer:
> 
>     x= 0
> 
>     class MyHandler(SocketServer.StreamRequestHandler):
>         def handle(self):
>             if x: # <---- How to get the X from the parent class?
>                   # Or how to pass a value to this class anyway?
>                 do_something()

Just say "MyServer.x".

Joe



More information about the Python-list mailing list