Near Final PEP 247 - API for Cryptographic Hash Functions

Roman Suzi rnd at onego.ru
Fri Sep 21 07:34:14 EDT 2001


On Fri, 21 Sep 2001, Oleg Broytmann wrote:

> On Thu, Sep 20, 2001 at 12:20:41PM -0400, Andrew Kuchling wrote:
> >     http://python.sourceforge.net/peps/pep-0247.html
> 
> Why not to define __repr__ and __str__?

 
>    __repr__ = hexdigest
> 
>    def str(self):
>       return "%s(%s)" % (self.__class__.__name__, self.hexdigest())

And more like that, repr representation should be recreatable
into digest-object again. So I propose to add new constructor which will
read hexdigest and make approprate object, that is this must be tru:

eval(repr(digestobj)) == digestobj

 
Sincerely yours, Roman A.Suzi
-- 
 - Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -
 






More information about the Python-list mailing list