def setNext(nxt):
    assert nxt==None or isinstance(nxt, Node), "next must be a Node"
    self.next = nxt

works ok, but it's uglier than it ought to be.

I don't find it that ugly. It's accurate, easy to read and understand. "What else ?" would say a famous coffee representative.
If you like perfection, replace nxt==None by nxt is None.

Jean-Michel
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to