# How do I use @jit wrapper interactively?

**URL:** <https://numba.discourse.group/t/how-do-i-use-jit-wrapper-interactively/859>\
**Category:** Support: How do I do ...?\
**Created:** [August 24, 2021, 1:17pm UTC](https://numba.discourse.group/t/how-do-i-use-jit-wrapper-interactively/859 "2021-08-24T13:17:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abitrolly](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/abitrolly/32/379_2.png) [@abitrolly](https://numba.discourse.group/u/abitrolly)\
**Post date:** [August 24, 2021, 1:17pm UTC](https://numba.discourse.group/t/how-do-i-use-jit-wrapper-interactively/859/1 "2021-08-24T13:17:14Z")

</div>

I want to quickly test Numba on various functions in IPython session. Going through my modules and decorating everything with `@jit` seem like a rather tedious task. Is there a way to use it with a function without modifying the original?

That would also help measure wrapped and non-wrapped functions in the same notebook.

---

<div class="post-metadata">

**Author:** ![Hannes](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/hannes/32/188_2.png) [@Hannes](https://numba.discourse.group/u/Hannes)\
**Post date:** [August 24, 2021, 2:11pm UTC](https://numba.discourse.group/t/how-do-i-use-jit-wrapper-interactively/859/2 "2021-08-24T14:11:41Z")

</div>

Hi @abitrolly ,

the `jit` decorator is a completely normal decorator. As such it is just syntactic sugar around a function that modifies other functions.

```python
@decorator
def f(x):
    return x

# The above is basically the same as
def f(x):
    return x
f = decorator(f)

```

You can therefore do this

```python
from numba import jit

def f(x):
    return x

# This is the plain replacement of @jit
f_jit = jit(f) 

#This is used when you want to pass extra options as in @jit(nopython=True)
f_jit_options = jit(nopython=True)(f) 

```

The reason that the latter works, is that `jit` is actually a little clever and figures out if the first argument passed is a function or not. If not it assumes you pass options and creates a specialised decorator on the fly, which is then applied to `f`. Otherwise the default options are used.

---

<div class="post-metadata">

**Author:** ![abitrolly](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/abitrolly/32/379_2.png) [@abitrolly](https://numba.discourse.group/u/abitrolly)\
**Post date:** [August 25, 2021, 9:42am UTC](https://numba.discourse.group/t/how-do-i-use-jit-wrapper-interactively/859/3 "2021-08-25T09:42:49Z")

</div>

`jit(nopython=True)(f)` is just what I need. Thanks. 😃
