[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

[issue31126] dict comprehension shouldn't raise UnboundLocalError

2017-08-06 Thread ksqsf
New submission from ksqsf: The code key = ["a", "b"] val = [1, 2] dic = {key:val for key in key for val in val} will raise UnboundLocalError in Python 3.6.2 and 2.7.13. Intuitively, the element 'key' and the list 'key' are not the same, so