Skip to content
Snippets Groups Projects
Commit ba9513ac authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[common][utils] Move _cmp from ListCreateExperimentsView to py3_cmp

Some code still uses it in other parts so make it easier to re-use.
parent 77c5d4ca
No related branches found
No related tags found
1 merge request!327Refactor update creation api
This commit is part of merge request !327. Comments created here will be created in the context of that merge request.
......@@ -135,3 +135,13 @@ def ensure_string(data):
return data.decode("utf-8")
return data
return ""
def py3_cmp(a, b):
"""
cmp is not available anymore in Python 3. This method is implemetend
as recommended in the documentation for this kind of use case.
Based on:
https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons
"""
return (a > b) - (a < b)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment