# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# %load_ext Cython

# # cdef function

# + language="cython"
#
# cdef my_func(x, y, z):
#     return x - y + z
#
# print(my_func(10, 20, 30))
# print(my_func(10.1, 20.9, 30.5))
# -

# ### You cannot access the cdef function outside the Cython cell

my_func(10, 20, 30)

# + language="cython"
#
# cdef int my_better_func(int x, int y):
#     return x + y
#
# print(my_better_func(10, 12))   # Runs without any error
#
# # print(my_better_func(10.2, 3.5)) # Error: Values are not of int type
# -

# # cpdef

# + language="cython"
#
# cpdef my_cpdef_func(x, y, z):
#     return x - y + z
#
# print(my_cpdef_func(10, 12, 13))
# -

# ### Accessible outside Cython cell

print(my_cpdef_func(10, 12, 13))



StarcoderdataJupyterScriptsDedupFiltered