Skip to content
Snippets Groups Projects
Commit c5e43fca authored by Samuel GAIST's avatar Samuel GAIST Committed by 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 1802185d
No related branches found
No related tags found
No related merge requests found
......@@ -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