[issue31225] allow hashlib `update' to accept str

2017-08-17 Thread Christian Heimes
Christian Heimes added the comment: Yes, what Antoine and Serhiy said. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue31225] allow hashlib `update' to accept str

2017-08-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Explicit is better than implicit. It is easy to add ".encode()" in the user code if it needs this. Adding this feature has non-zero (and actually not a small) cost. Since update() is not just a method, but a part of a protocol, you need to update all imple

[issue31225] allow hashlib `update' to accept str

2017-08-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: This will never happen as this is precisely the kind of confusion Python 3 was designed to avoid. -- nosy: +pitrou resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue31225] allow hashlib `update' to accept str

2017-08-17 Thread ksqsf
New submission from ksqsf: It'll be nice if `update' can accept str directly, rather than str.encode first. One of the most common use cases is "m.update(s.encode())", so it shouldn't make a big difference to just use "m.update(s)"; after all, users who want to specify encoding explicitly can