# Sending an attribute of an object to a remote function through the object ref

**URL:** <https://discuss.ray.io/t/sending-an-attribute-of-an-object-to-a-remote-function-through-the-object-ref/8387>\
**Category:** Ray Core\
**Created:** [November 22, 2022, 8:42am UTC](https://discuss.ray.io/t/sending-an-attribute-of-an-object-to-a-remote-function-through-the-object-ref/8387 "2022-11-22T08:42:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammed](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mohammed/32/586_2.png) [@mohammed](https://discuss.ray.io/u/mohammed)\
**Post date:** [November 22, 2022, 8:42am UTC](https://discuss.ray.io/t/sending-an-attribute-of-an-object-to-a-remote-function-through-the-object-ref/8387/1 "2022-11-22T08:42:01Z")

</div>

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

- Medium: It contributes to significant difficulty to complete my task, but I can work around it.

Hi everyone,

So I have a remote function (2) that I need to give it an attribute of an object, however, I have the object ref of this object since I get it from another remote function (1). I would like to know how I can somehow reference the attribute of the object and send it to function 2, without having to do ray.get().

Minimal example:

```auto
class Dummy:
    def __init__ (self):
        self.value = 3
dummy = Dummy()
print(dummy.value)
dummy_ref = ray.put(dummy)

@ray.remote
def get_value(value):
    return value

value_ref = get_value.remote(dummy_ref.value)

```

I know that I can modify get\_value to take the object reference, but I can’t do that in my code.

```auto
# As I requirement of my code doing this is not possible, or will break a lot of the abstraction that I have
@ray.remote
def get_value(obj):
    return obj.value

```

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [November 24, 2022, 11:35am UTC](https://discuss.ray.io/t/sending-an-attribute-of-an-object-to-a-remote-function-through-the-object-ref/8387/2 "2022-11-24T11:35:42Z")

</div>

It’s not possible to reference the attribute from the object ref without calling ray.get. Why can’t you use ray.get here? If your object is zero-copyable, the overhead should be small. Otherwise, you can probably make the “value” itself a reference.

```nohighlight
class Dummy:
    def __init__ (self):
        self.value = ray.put(3)
dummy = Dummy()
print(dummy.value)

@ray.remote
def get_value(value):
    return value

value_ref = get_value.remote(dummy.value)

```
