# Python None in Fish

**URL:** https://forum.itascainternational.com/t/python-none-in-fish/966
**Category:** Wish List
**Tags:** python, fish
**Created:** [March 20, 2023, 10:29am UTC](https://forum.itascainternational.com/t/python-none-in-fish/966 "2023-03-20T10:29:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Theophile](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.itascainternational.com/theophile/32/299_2.png) [@Theophile](https://forum.itascainternational.com/u/Theophile)
#### Post date: [March 20, 2023, 10:29am UTC](https://forum.itascainternational.com/t/python-none-in-fish/966/1 "2023-03-20T10:29:00Z")

</div>

Hi everyone!

I would have a small request: would it be possible to have a _Fish_ binding to _Python_ `None`?

As of 3DEC v7.00.157, _Python_ `None` converts to _Fish_ vector3 `(0.,0.,0.)` while `(0.,0.,0.)` gives an itasca.vec3 in return.  
It would be great to have an actual bijection to avoid troubles when converting back from _Fish_ to _Python_

The closest thing to `None` singleton I could think of is _Fish_ `null` pointer.  
To date, trying to get `null` using `itasca.fish.get` raises an error in _Python_.

I am not sure it is easily feasible, or if using `null` is relevant.  
Anyway, thanks for your answer!

Regards,

Théophile

---

<div class="post-metadata">

### Author: ![Huy](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@Huy](https://forum.itascainternational.com/u/Huy)
#### Post date: [March 27, 2023, 3:55pm UTC](https://forum.itascainternational.com/t/python-none-in-fish/966/2 "2023-03-27T15:55:07Z")

</div>

Hi,

There is a bug here.I agree that Python None should convert to a null pointer not vector(0,0,0).

Then you can use exception to get a null pointer. For example

```auto
import itasca as it 
try:
    x = it.fish.get("x")
except SystemError:
    x = None

```

Well, it’s just a hack. We need to fix it .

---

<div class="post-metadata">

### Author: ![Theophile](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.itascainternational.com/theophile/32/299_2.png) [@Theophile](https://forum.itascainternational.com/u/Theophile)
#### Post date: [March 28, 2023, 7:36am UTC](https://forum.itascainternational.com/t/python-none-in-fish/966/3 "2023-03-28T07:36:11Z")

</div>

Hi @Huy , thanks for your answer!

The hack does the trick indeed.  
An actual binding would be great.  
For exemple, we’re working on a module where we link _Python_ functions to _Fish_ functions and a true binding would help having a proper linking.

Anyway, thanks for the hint!

Théophile

---

<div class="post-metadata">

### Author: ![Theophile](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.itascainternational.com/theophile/32/299_2.png) [@Theophile](https://forum.itascainternational.com/u/Theophile)
#### Post date: [March 29, 2024, 3:59pm UTC](https://forum.itascainternational.com/t/python-none-in-fish/966/4 "2024-03-29T15:59:01Z")

</div>

Hi @Huy !

By chance, is there any plan to integrate this feature in a next 3DEC update?

Thanks !

Cheers

Théophile

---

<div class="post-metadata">

### Author: ![Huy](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@Huy](https://forum.itascainternational.com/u/Huy)
#### Post date: [April 2, 2024, 8:56am UTC](https://forum.itascainternational.com/t/python-none-in-fish/966/5 "2024-04-02T08:56:02Z")

</div>

I’ll put in the development list.

---

<div class="post-metadata">

### Author: ![Theophile](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.itascainternational.com/theophile/32/299_2.png) [@Theophile](https://forum.itascainternational.com/u/Theophile)
#### Post date: [April 2, 2024, 1:01pm UTC](https://forum.itascainternational.com/t/python-none-in-fish/966/6 "2024-04-02T13:01:57Z")

</div>

Great, thanks a lot!
