# Idea: shortcut notation for Union{T, Nothing}

**URL:** <https://discourse.julialang.org/t/idea-shortcut-notation-for-union-t-nothing/71895>\
**Category:** General Usage\
**Created:** [November 22, 2021, 3:01pm UTC](https://discourse.julialang.org/t/idea-shortcut-notation-for-union-t-nothing/71895 "2021-11-22T15:01:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_Sagaert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steven_sagaert/32/29578_2.png) [@Steven\_Sagaert](https://discourse.julialang.org/u/Steven_Sagaert)\
**Post date:** [November 22, 2021, 3:01pm UTC](https://discourse.julialang.org/t/idea-shortcut-notation-for-union-t-nothing/71895/1 "2021-11-22T15:01:45Z")

</div>

It would be nice if Union{T, Nothing} could be notated as T? like in Kotlin, C# etc.

Not necessary but nice to have. Makes the code more compact and readable.

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [November 22, 2021, 3:10pm UTC](https://discourse.julialang.org/t/idea-shortcut-notation-for-union-t-nothing/71895/2 "2021-11-22T15:10:08Z")

</div>

x-ref: [https://github.com/JuliaLang/julia/issues/36628](https://github.com/JuliaLang/julia/issues/36628) and the linked discourse thread there.

---

<div class="post-metadata">

**Author:** ![alexten](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexten/32/209104_2.png) [@alexten](https://discourse.julialang.org/u/alexten)\
**Post date:** [November 21, 2024, 11:02am UTC](https://discourse.julialang.org/t/idea-shortcut-notation-for-union-t-nothing/71895/3 "2024-11-21T11:02:22Z")

</div>

Would also be nice to be able to write a type union with a symbol, e.g., `|`. Thus, `Union{T, Nothing}` \equiv `T | Nothing` or something like that.
