# Get union type in python

**URL:** <https://forum.opencyphal.org/t/get-union-type-in-python/343>\
**Category:** PyCyphal\
**Created:** [February 3, 2019, 10:15am UTC](https://forum.opencyphal.org/t/get-union-type-in-python/343 "2019-02-03T10:15:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deekay](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/d/8491ac/32.png) [@deekay](https://forum.opencyphal.org/u/deekay)\
**Post date:** [February 3, 2019, 10:15am UTC](https://forum.opencyphal.org/t/get-union-type-in-python/343/1 "2019-02-03T10:15:21Z")

</div>

Hi!

This is rather a simple python question than a pyuavcan question perhaps… But how do I detect the union type of a broadcasted message payload?

Lets say a broadcasted message contains `uavcan.protocol.param.Value` and the source node has set `real_value`.

How does the subscriber, inside the callback, parse and detect the type?

/python newbie

---

<div class="post-metadata">

**Author:** ![deekay](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/d/8491ac/32.png) [@deekay](https://forum.opencyphal.org/u/deekay)\
**Post date:** [February 3, 2019, 10:19am UTC](https://forum.opencyphal.org/t/get-union-type-in-python/343/2 "2019-02-03T10:19:22Z")

</div>

I just noticed uavcan.get\_active\_union\_field !!!

=)
