Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8370459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:55:03+00:00 2026-06-09T13:55:03+00:00

More and more we use chained function calls: value = get_row_data(original_parameters).refine_data(leval=3).transfer_to_style_c() It can be

  • 0

More and more we use chained function calls:

value = get_row_data(original_parameters).refine_data(leval=3).transfer_to_style_c()

It can be long. To save long line in code, which is prefered?

value = get_row_data(
    original_parameters).refine_data(
    leval=3).transfer_to_style_c()

or:

value = get_row_data(original_parameters)\
       .refine_data(leval=3)\
       .transfer_to_style_c()

I feel it good to use backslash \, and put .function to new line. This makes each function call has it own line, it’s easy to read. But this sounds not preferred by many. And when code makes subtle errors, when it’s hard to debug, I always start to worry it might be a space or something after the backslash (\).

To quote from the Python style guide:

Long lines can be broken over multiple lines by wrapping expressions
in parentheses. These should be used in preference to using a
backslash for line continuation. Make sure to indent the continued
line appropriately. The preferred place to break around a binary
operator is after the operator, not before it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:55:04+00:00Added an answer on June 9, 2026 at 1:55 pm

    I tend to prefer the following, which eschews the non-recommended \ at the end of a line, thanks to an opening parenthesis:

    value = (get_row_data(original_parameters)
             .refine_data(level=3)
             .transfer_to_style_c())
    

    One advantage of this syntax is that each method call is on its own line.

    A similar kind of \-less structure is also often useful with string literals, so that they don’t go beyond the recommended 79 character per line limit:

    message = ("This is a very long"
               " one-line message put on many"
               " source lines.")
    

    This is a single string literal, which is created efficiently by the Python interpreter (this is much better than summing strings, which creates multiple strings in memory and copies them multiple times until the final string is obtained).

    Python’s code formatting is nice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am hoping to use Groovy more as a functional language than I can
I don't know how to get to use more than one client function in
How can we use more than one instruments at the same time ? I'm
You can use more than one css class in an HTML tag in current
I want to use more than one filter on template like below: value: {{
The more I use Parallel.ForEach and PLINQ in my code, the more faces and
is there a way to configure trac to use more than one svn repo
I am interested in an array of software ideas and use more than one
Make it on Linux. The reason to use more than one version of Vim,
I have been using Haskell for quite a while. The more I use it,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.