-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parens to |> docstring #36155
Add parens to |> docstring #36155
Conversation
I feel like it is valuable to add your comment here into the function documentation. Not the broadcasted pipelining - the operator precedence. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ViralBShah WDYT?
@jonniedie Can you rebase to master, and we can get this merged. |
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
@ViralBShah I... don't know if I actually did that correctly. I've never done this before. |
It is a common misunderstanding that
data |> x -> f(x) |> g
parses to
data |> (x -> f(x)) |> g
when it actually parses to
data |> x -> (f(x) |> g)
due to
|>
operator precedence. This can lead to unexpected behavior when using broadcasted pipelining. Using the docstring example with a broadcasted pipeline operator:Having an anonymous function without enclosing parentheses in the docstring for
|>
may promote this misunderstanding.