Skip to content

Conversation

@shen-shanshan
Copy link
Contributor

Thank you for contributing to Ray! 🚀
Please review the Ray Contribution Guide before opening a pull request.

⚠️ Remove these instructions before submitting your PR.

💡 Tip: Mark as draft if you want early feedback, or ready for review when it's complete.

Description

Minor Fix for typos in https://docs.ray.io/en/latest/ray-core/actors.html#type-hints-and-static-typing-for-actors.

The ``...`` in **...** is invalid.

Related issues

Additional information

Signed-off-by: Shanshan Shen <[email protected]>
@shen-shanshan shen-shanshan requested review from a team as code owners October 23, 2025 08:22
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes invalid reStructuredText markup in the actors documentation. The change is valid, but I've suggested an alternative that could improve readability by removing the bold formatting from the list items, as the code literals are already highlighted, making the text cleaner.

Comment on lines +388 to +392
- **Prefer** ``ray.remote(MyClass)`` **over** ``@ray.remote`` **for actors**: Instead of decorating your class with ``@ray.remote``, use ``ActorClass = ray.remote(MyClass)``. This preserves the original class type and allows type checkers and IDEs to infer the correct types.
- **Use ``@ray.method`` for actor methods**: Decorate actor methods with ``@ray.method`` to enable type hints for remote method calls on actor handles.
- **Use** ``@ray.method`` **for actor methods**: Decorate actor methods with ``@ray.method`` to enable type hints for remote method calls on actor handles.
- **Use the ``ActorClass`` and ``ActorProxy`` types**: When you instantiate an actor, annotate the handle as ``ActorProxy[MyClass]`` to get type hints for remote methods.
- **Use the** ``ActorClass`` **and** ``ActorProxy`` **types**: When you instantiate an actor, annotate the handle as ``ActorProxy[MyClass]`` to get type hints for remote methods.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Thanks for fixing the invalid markup! While your change is correct, the resulting formatting with interspersed bold text can be a bit visually jarring. For better readability and a cleaner look, you might consider removing the bolding from these list items entirely. The code literals are already highlighted with backticks, which provides sufficient emphasis.

Suggested change
- **Prefer** ``ray.remote(MyClass)`` **over** ``@ray.remote`` **for actors**: Instead of decorating your class with ``@ray.remote``, use ``ActorClass = ray.remote(MyClass)``. This preserves the original class type and allows type checkers and IDEs to infer the correct types.
- **Use ``@ray.method`` for actor methods**: Decorate actor methods with ``@ray.method`` to enable type hints for remote method calls on actor handles.
- **Use** ``@ray.method`` **for actor methods**: Decorate actor methods with ``@ray.method`` to enable type hints for remote method calls on actor handles.
- **Use the ``ActorClass`` and ``ActorProxy`` types**: When you instantiate an actor, annotate the handle as ``ActorProxy[MyClass]`` to get type hints for remote methods.
- **Use the** ``ActorClass`` **and** ``ActorProxy`` **types**: When you instantiate an actor, annotate the handle as ``ActorProxy[MyClass]`` to get type hints for remote methods.
- Prefer ``ray.remote(MyClass)`` over ``@ray.remote`` for actors: Instead of decorating your class with ``@ray.remote``, use ``ActorClass = ray.remote(MyClass)``. This preserves the original class type and allows type checkers and IDEs to infer the correct types.
- Use ``@ray.method`` for actor methods: Decorate actor methods with ``@ray.method`` to enable type hints for remote method calls on actor handles.
- Use the ``ActorClass`` and ``ActorProxy`` types: When you instantiate an actor, annotate the handle as ``ActorProxy[MyClass]`` to get type hints for remote methods.

@ray-gardener ray-gardener bot added core Issues that should be addressed in Ray Core community-contribution Contributed by the community labels Oct 23, 2025
@jjyao jjyao added the go add ONLY when ready to merge, run all tests label Oct 23, 2025
Copy link
Collaborator

@jjyao jjyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jjyao jjyao merged commit bc49352 into ray-project:master Oct 24, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants