# Modifying existing @ray.remote-decorated Actor

**URL:** <https://discuss.ray.io/t/modifying-existing-ray-remote-decorated-actor/14598>\
**Category:** Ray Core\
**Created:** [May 6, 2024, 6:11pm UTC](https://discuss.ray.io/t/modifying-existing-ray-remote-decorated-actor/14598 "2024-05-06T18:11:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgerstgrasser](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mgerstgrasser/32/2728_2.png) [@mgerstgrasser](https://discuss.ray.io/u/mgerstgrasser)\
**Post date:** [May 6, 2024, 6:11pm UTC](https://discuss.ray.io/t/modifying-existing-ray-remote-decorated-actor/14598/1 "2024-05-06T18:11:09Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- High: It blocks me to complete my task.

I have an existing third-party library that uses Ray under the hood, and I would like to modify the behavior of (one method of) one specific Ray Actor class (decorated with `@ray.remote`) from that code. So this looks something like this:

```auto
@ray.remote
class some_class(parent_class):
    ... init and other methods ...
    def method_i_want_to_modify(self, args):
        pass
    ... more methods ...

```

Ideally I’d like to change the behavior of `method_i_want_to_modify()` without having to change anything else. Usually I’d try to monkey-patch that method only, but this doesn’t seem to have any effect.  
I.e.

```auto
from library import some_class
def my_patched_method(self,args):
    print("my patched method")
some_class.method_i_want_to_modify = my_patched_method
...

```

→ `my_patched_method` never gets called.

Class inheritance would be another option, but again doesn’t work on `@ray.remote` decorated classes.

Is there another way to do modify already-decorated remote Ray Actors? The only way I see right now is to maintain my own patched fork of the underlying library, but that wouldn’t be ideal.
