# Surprising struct equality test

**URL:** <https://discourse.julialang.org/t/surprising-struct-equality-test/4890>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 17, 2017, 12:24am UTC](https://discourse.julialang.org/t/surprising-struct-equality-test/4890 "2017-07-17T00:24:30Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 17, 2017, 8:50am UTC](https://discourse.julialang.org/t/surprising-struct-equality-test/4890/6 "2017-07-17T08:50:34Z")

</div>

You can redefine `Base.:(==)`, but it may break some implicit assumptions in existing code, also, you need to define hashing. For the moment, you are better off defining your own equality operator. I posted [an example](https://discourse.julialang.org/t/what-general-purpose-commands-do-you-usually-end-up-adding-to-your-projects/4889) in a parallel topic.

---

_[View the full topic](https://discourse.julialang.org/t/surprising-struct-equality-test/4890)._
