ruby / ruby/www.ruby-lang.org

To Ruby from Python - f-strings/expression substitution

Open
#3,073 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
944
Forks
673
Avg merge
2d 6h
Merged PRs (30d)
9

Description

Heya,

I'm brand new to Ruby so I hope I'm not mistaken with this issue.

I was looking at this page: https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-python/

The fourth point in "differences" is:

... a special “expression substitution” syntax (which allows you to insert the results of Ruby expressions directly into other strings without having to "add " + "strings " + "together"). ...

I get the sense that the expression substitution is the same as f-strings in Python which were introduced in 3.6. f"Hello {name}"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the “differences” section of documentation/ruby-from-other-languages/to-ruby-from-python/ and review its fourth point alongside the linked Python f-string example. Clarify whether the comparison is accurate and update the page so the relationship between the two syntaxes is unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, ruby
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.