[issue19259] Provide Python implementation of operator.compare_digest()

2021-10-20 Thread Christian Heimes
Christian Heimes added the comment: There is no agreement where to put the function. In the past seven years nobody else has requested a pure Python implementation, too. I'm closing my feature request as rejected. -- resolution: -> rejected stage: needs patch -> resolved status: ope

[issue19259] Provide Python implementation of operator.compare_digest()

2014-06-23 Thread STINNER Victor
STINNER Victor added the comment: Ping? -- versions: +Python 3.5 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue19259] Provide Python implementation of operator.compare_digest()

2013-10-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry Christian, but I think this just clutter's the operator module. I agree with Terry that it doesn't belong here. The hashlib module might be a better choice. That's where I would start looking for it if I needed a function like this. -- n

[issue19259] Provide Python implementation of operator.compare_digest()

2013-10-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: attrgetter and itemgetter are partial versions of getattr (. operator) and op.getitem ([] operator). I see now that _compare_digest might have more clearly been named _eq_strng_slow ;-). ('Compare' implies to me a -1, 0, 1 return.) Are you planning to leave t

[issue19259] Provide Python implementation of operator.compare_digest()

2013-10-19 Thread Christian Heimes
Christian Heimes added the comment: it's in the _operator module because we needed a place to put it that is *always* available. The C backend for the hashlib module is only available on platforms with OpenSSL (hence the internal name Modules/_hashopenssl.c). The operator module already contai

[issue19259] Provide Python implementation of operator.compare_digest()

2013-10-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: -1 "The operator module exports a set of efficient functions corresponding to the intrinsic operators of Python." As far as I know, _compare_digest does not correspond to any operator. -- nosy: +terry.reedy ___ Pyth

[issue19259] Provide Python implementation of operator.compare_digest()

2013-10-18 Thread Zachary Ware
Zachary Ware added the comment: Even after reading through #15061, I still wonder why _compare_digest is in _operator at all. It makes even less sense to me to put a Python implementation in operator; shouldn't the Python implementation be in the module that actually uses it? Branching from

[issue19259] Provide Python implementation of operator.compare_digest()

2013-10-18 Thread Zachary Ware
Zachary Ware added the comment: Oops, forgot to provide the [1] link... [1] https://mail.python.org/pipermail/python-dev/2013-October/129477.html -- ___ Python tracker ___ _

[issue19259] Provide Python implementation of operator.compare_digest()

2013-10-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: It explains why the function isn't implemented in Python, it doesn't say that there shouldn't be a best-effort Python fallback. All in all, Christian's version looks reasonable. All arithmetic is done on small ints, so there shouldn't be a strong data-dependen

[issue19259] Provide Python implementation of operator.compare_digest()

2013-10-14 Thread STINNER Victor
STINNER Victor added the comment: #15061 explains why the function is not implemented in Python :) -- nosy: +haypo ___ Python tracker ___

[issue19259] Provide Python implementation of operator.compare_digest()

2013-10-14 Thread Christian Heimes
New submission from Christian Heimes: The operator module doesn't have a Python implementation of _compare_digest. This code mimicks the C code: def _compare_digest(a, b): if isinstance(a, str) and isinstance(b, str): a = a.encode("ascii") b = b.encode("ascii") a = memor