Problem with sha.new

and-google at doxdesk.com and-google at doxdesk.com
Sat Jul 9 14:05:25 CEST 2005


Florian Lindner wrote:

>         sha = sha.new(f.read())

> this generates a traceback when sha.new() is called for the second time

You have reassigned the variable 'sha'.

First time around, sha is the sha module object as obtained by 'import
sha'. Second time around, sha is the SHA hashing object you used the
first time around. This does not have a 'new' method.

Python does not have separate namespaces for packages and variables.
Modules are stored in variables just like any other object.

-- 
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/




More information about the Python-list mailing list