I don't find it that ugly. It's accurate, easy to read and understand. "What else ?" would say a famous coffee representative.def setNext(nxt): assert nxt==None or isinstance(nxt, Node), "next must be a Node" self.next = nxtworks ok, but it's uglier than it ought to be.
If you like perfection, replace nxt==None by nxt is None. Jean-Michel -- http://mail.python.org/mailman/listinfo/python-list