asyncore question

Steve Holden steve at holdenweb.com
Wed Nov 23 12:40:56 EST 2005


Stéphane Ninin wrote:
>   Hello,
> 
> Probably a stupid question... but still:
> 
> 
>>>>from asyncore import dispatcher
>>>>d=dispatcher()
>>>>print d
> 
> None
> 
>>>>d
> 
> <asyncore.dispatcher at 0x8d9080>
> 
>>>>print type(d)
> 
> <type 'instance'>
> 
>>>>d.__class__
> 
> <class asyncore.dispatcher at 0x008DF150>
> 
>>>>d is None
> 
> False
> 
>>>>^Z
> 
> 
> why  
> 
>>>>print d
> 
> prints None ?
> 
> 
> 
>    Thanks for your answers,
> 
> 
> 
At a guess, because it has a __str__() method that doesn't return 
anything, while its __repr__() method is probably inherited from object 
or instance.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list