Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in sorting addable items #238

Open
tiberiuichim opened this issue Nov 16, 2021 · 0 comments
Open

Error in sorting addable items #238

tiberiuichim opened this issue Nov 16, 2021 · 0 comments

Comments

@tiberiuichim
Copy link

results = [
(translate(ctype["title"], context=request), ctype) for ctype in results
]
results.sort()
results = [ctype[-1] for ctype in results]

If the ctype is a dictionary, then this whole thing is not sortable.

Python 3.8.8 (default, Mar 31 2021, 10:26:24) 
[GCC 10.2.0] on linux
@>>> [('a', {'a':1}), ('a', {'a':0})].sort()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'dict' and 'dict'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant