# sort(keys(Dict(:a =\> 1, :b =\> 2))) throws MethodError

**URL:** https://discourse.julialang.org/t/sort-keys-dict-a-1-b-2-throws-methoderror/97701
**Category:** General Usage
**Tags:** question
**Created:** [April 20, 2023, 12:31pm UTC](https://discourse.julialang.org/t/sort-keys-dict-a-1-b-2-throws-methoderror/97701 "2023-04-20T12:31:59Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)
#### Post date: [April 20, 2023, 12:55pm UTC](https://discourse.julialang.org/t/sort-keys-dict-a-1-b-2-throws-methoderror/97701/8 "2023-04-20T12:55:51Z")

</div>

I found this related older issue [I found this related discussion, which also does not have a good answer](https://discourse.julialang.org/t/can-you-sort-a-set/47948/7)

where an alternative solution is to use PriorityQueue, but that of course does not make too much sense in this context where I want to sort the keys from a Dict

---

_[View the full topic](https://discourse.julialang.org/t/sort-keys-dict-a-1-b-2-throws-methoderror/97701)._
