# Defining a type in the parameters function

**URL:** <https://forum.inductiveautomation.com/t/defining-a-type-in-the-parameters-function/97070>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [October 10, 2024, 10:09am UTC](https://forum.inductiveautomation.com/t/defining-a-type-in-the-parameters-function/97070 "2024-10-10T10:09:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [October 10, 2024, 10:09am UTC](https://forum.inductiveautomation.com/t/defining-a-type-in-the-parameters-function/97070/1 "2024-10-10T10:09:26Z")

</div>

It is possible to define a type in paramers in functions?

Something like this:

```python
def __init__ (self, execution_ok: int, message=None: str, additional_info=None):

```

It throws an error in the first `:` that expected a `RPAREN`, I suposse it expects to close the definition.

Any idea if this is possible in this version of Jython?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [October 10, 2024, 10:51am UTC](https://forum.inductiveautomation.com/t/defining-a-type-in-the-parameters-function/97070/2 "2024-10-10T10:51:39Z")

</div>

You may try:

```python
def __init__ (self, execution_ok, message=None, additional_info=None):
    if not isinstance(execution_ok, int):
        raise TypeError("execution_ok must be an integer")
    if message is not None and not isinstance(message, str):
        raise TypeError("message must be a string")
    # Function logic here

```

Jython follows Python 2.x syntax and does not support Python 3.x features such as type hints
