# Syntactic sugar for types

**URL:** <https://discourse.julialang.org/t/syntactic-sugar-for-types/119685>\
**Category:** General Usage\
**Created:** [September 21, 2024, 10:09pm UTC](https://discourse.julialang.org/t/syntactic-sugar-for-types/119685 "2024-09-21T22:09:27Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![MilesCranmer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milescranmer/32/21070_2.png) [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Post date:** [September 22, 2024, 6:46pm UTC](https://discourse.julialang.org/t/syntactic-sugar-for-types/119685/9 "2024-09-22T18:46:30Z")

</div>

> [@stevengj](#):
>
> I think the main reason that these proposals have come up only recently, more than a decade into Julia’s development, is `type1 | type2` syntax has recently been adopted and popularized in Python. But “spell things more like Python” has never been a huge priority for Julia

Within the lengthy thread on this topic are some comments [discussing precisely this point](https://discourse.julialang.org/t/proposed-alias-for-union-types/108205/23), so I think we should avoid rehashing things. I also have no energy left for this topic (having given up long ago)

@andrey2185 At the end of the day, the nice thing about Julia is that you can just overload `|` in your `config/startup.jl` file to use this syntax in your REPL. And if wanting to use it in a package you can just depend on InfixUnions.jl.

---

_[View the full topic](https://discourse.julialang.org/t/syntactic-sugar-for-types/119685)._
