# Task switch not allowed from inside staged nor pure functions

**URL:** <https://discourse.julialang.org/t/task-switch-not-allowed-from-inside-staged-nor-pure-functions/20488>\
**Category:** General Usage\
**Tags:** question\
**Created:** [February 5, 2019, 9:35pm UTC](https://discourse.julialang.org/t/task-switch-not-allowed-from-inside-staged-nor-pure-functions/20488 "2019-02-05T21:35:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![bennedich](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bennedich/32/4894_2.png) [@bennedich](https://discourse.julialang.org/u/bennedich)\
**Post date:** [February 5, 2019, 9:58pm UTC](https://discourse.julialang.org/t/task-switch-not-allowed-from-inside-staged-nor-pure-functions/20488/4 "2019-02-05T21:58:59Z")

</div>

> [@chakravala](#):
>
> I know some people might suggest that I should not be using `@pure` methods in certain contexts; however, I am having success with them if they are used safely. It is my choice to work with it

In a [recent topic](https://discourse.julialang.org/t/mutable-struct-vs-closure/20233/60), several posters warned you that your “pure” code was in fact not pure, and that you shouldn’t declare it such… It’s your choice to work with it, but consider that users of your package will have no choice but to work with it too (with issues like this).

> [@chakravala](#):
>
> Is there some way to disable the logging which causes this error?

> [@chakravala](#):
>
> I didn’t use any log messages

Hmm, is it not the `@info` statement at Grassmann.jl:136 that triggers this? Could you wrap that in a try/catch? (or remove it/move it outside the pure function, as @tkoolen suggests)

---

_[View the full topic](https://discourse.julialang.org/t/task-switch-not-allowed-from-inside-staged-nor-pure-functions/20488)._
