Eugene Rossokha <ar...@protonmail.com> added the comment:
I find the following behaviour very confusing: >>> import random >>> a = bytearray("1234", "utf-8") >>> b = bytearray("1234", "utf-8") >>> a == b True >>> random.seed(a) >>> a == b False >>> a bytearray(b'1234\xd4\x04U\x9f`.\xabo\xd6\x02\xacv\x80\xda\xcb\xfa\xad\xd1603^\x95\x1f\tz\xf3\x90\x0e\x9d\xe1v\xb6\xdb(Q/.\x00\x0b\x9d\x04\xfb\xa5\x13>\x8b\x1cn\x8d\xf5\x9d\xb3\xa8\xab\x9d`\xbeK\x97\xcc\x9e\x81\xdb') >>> b bytearray(b'1234') The function doesn't document it will change the input argument ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44018> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com