[Tutor] TRULY NEWBIE - MENTOR NEEDED

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! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



More information about the Tutor mailing list