[Twisted-Python] doc/core/howto/components.xhtml question
![](https://secure.gravatar.com/avatar/c6d123768eac323f253b600dc45d2727.jpg?s=120&d=mm&r=g)
in doc/core/howto/components.xhtml there is a HairDryer class like this: class HairDryer: def plug(self, socket): adapted = IAmericanSocket(socket) assert socket.voltage() == 110, "BOOM" print "I was plugged in properly and am operating" I am new to this interface / adaptation system, but I am thinking it should be: class HairDryer: def plug(self, socket): adapted = IAmericanSocket(socket) assert adapted.voltage() == 110, "BOOM" print "I was plugged in properly and am operating" If so... Index: doc/core/howto/components.xhtml =================================================================== --- doc/core/howto/components.xhtml (revision 12146) +++ doc/core/howto/components.xhtml (working copy) @@ -338,7 +338,7 @@ class HairDryer: def plug(self, socket): adapted = IAmericanSocket(socket) - assert socket.voltage() == 110, "BOOM" + assert adapted.voltage() == 110, "BOOM" print "I was plugged in properly and am operating" </pre> _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.com/
participants (2)
-
exarkun@divmod.com
-
Lee Harr