# How to call inplace (! convention) functions with JuliaCall?

**URL:** <https://discourse.julialang.org/t/how-to-call-inplace-convention-functions-with-juliacall/122155>\
**Category:** General Usage\
**Tags:** python, juliacall\
**Created:** [November 1, 2024, 9:11pm UTC](https://discourse.julialang.org/t/how-to-call-inplace-convention-functions-with-juliacall/122155 "2024-11-01T21:11:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcsgil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marcsgil/32/33908_2.png) [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Post date:** [November 1, 2024, 9:11pm UTC](https://discourse.julialang.org/t/how-to-call-inplace-convention-functions-with-juliacall/122155/1 "2024-11-01T21:11:29Z")

</div>

Hello!

I’m trying to wrap a Julia package in Python using [JuliaCall.jl](https://juliapy.github.io/PythonCall.jl/stable/juliacall/). I have many functions in Julia that have both an in place version `f!`, and a corresponding out of place `f`. Unfortunately, one cannot have `!` in as part of the name of a Python function, so that I cannot call `jl.f!` in Python. Is there a workaround?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [November 1, 2024, 10:00pm UTC](https://discourse.julialang.org/t/how-to-call-inplace-convention-functions-with-juliacall/122155/2 "2024-11-01T22:00:02Z")

</div>

`!` at the end of a function isn’t syntax, it’s convention. If you want to call it from python, give it another name.

---

<div class="post-metadata">

**Author:** ![marcsgil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marcsgil/32/33908_2.png) [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Post date:** [November 1, 2024, 10:42pm UTC](https://discourse.julialang.org/t/how-to-call-inplace-convention-functions-with-juliacall/122155/3 "2024-11-01T22:42:48Z")

</div>

Yes, I meant convention, sorry for the misunderstanding. I’m actually trying to wrap a Julia package that I wrote and which contains lots of functions with both `f` and `f!` versions. I could release a new version of the package adding `f_ip = f!` for all of them, but it seems very cumbersome. Would there be a better way?

I also edited the original post to make question clearer.

---

<div class="post-metadata">

**Author:** ![cjdoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cjdoris/32/213133_2.png) [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Post date:** [November 1, 2024, 11:13pm UTC](https://discourse.julialang.org/t/how-to-call-inplace-convention-functions-with-juliacall/122155/4 "2024-11-01T23:13:31Z")

</div>

You can do `jl.f_b` - the trailing `_b` (B for bang) is converted to `!` for you.

Or less magically you can do `getattr(jl, "f!")`.
