Re: Problem with sha.new
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Problem with sha.new

From: <and-google@doxdesk.com>
Date: Sat Jul 09 2005 - 14:05:25 CEST

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@doxdesk.com
http://www.doxdesk.com/
Received on Thu Sep 29 16:50:58 2005