mike donato yncdonato at msn.com
Tue Nov 22 23:41:22 CET 2005

Greetings, I am new student to programming and am experimenting with PYTHON. 
>From what I have read, seems to be a very versatile language. In the 
following excercise I am getting an error

class String(str, Object):

    shift = 6

    mask = ~0 << (31 - shift)

    def __hash__(self):
        result = 0
        for c in self:
            result = ((result & String.mask) ^
		result << String.shift ^ ord(c)) & sys.maxint
        return result

    # ...

Traceback (most recent call last):
  File "<pyshell#0>", line 11, in -toplevel-
    class String(str, Object):
NameError: name 'Object' is not defined

Express yourself instantly with MSN Messenger! Download today it's FREE! 

More information about the Tutor mailing list