Near Final PEP 247 - API for Cryptographic Hash Functions

Aahz Maruch aahz at panix.com
Fri Sep 28 11:02:57 EDT 2001


In article <3dofnztka2.fsf at ute.cnri.reston.va.us>,
Andrew Kuchling  <akuchlin at mems-exchange.org> wrote:
>"Tim Peters" <tim.one at home.com> writes:
>>
>> It's unclear whether all modules conforming to this spec must support both
>> flavors of "new".  The syntax of the second flavor of new() is also unclear;
>> perhaps
>>     new(key[, string])
>> was intended?  I expect I'd like it better if the string argument always
>> came first, and that hash methods requiring a key require a keyword "key="
>> argument.
>
>A recent suggestion from Rich Salz is to be even more minimal and
>simply drop the string argument to the constructor; that's not such a
>bad idea, since it ensures TOOWTDI.  (Obviously I wouldn't rip out the
>initial string argument for the MD5 and SHA modules included with
>Python.)

How about flipping Tim's suggestion around and making the string
argument keyword based?
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

We must not let the evil of a few trample the freedoms of the many.



More information about the Python-list mailing list