I want to know why "Word('zhiying') == Word('navaln')" is true?

Because your __new__ method returns None for any word with no space in it. Probably you want to unindent the return statement. You can even see this problem in your console output — when you try len(Word('zhiying')) you get an error about NoneType.

Leave a Comment