4 ms·
You don't need to escape line endings within parens: (someobject .do_something() .do_something())
by pyre 15y ago
You don't need to escape line endings within parens:
(someobject
.do_something()
.do_something())
- phzbOx 15y agoYeah. That's the hack I use, but it makes it a bit no pythonic.
- pyre 15y agoFrom what I gather, the Pythonic way to write that would be: some_object.do_something().do_something()\ .do_something().last_thing() Basically, go to the end of the line and wrap with an indent. That's the way that I see most function calls with a long list of arguments in Python. In Perl, you might see something like: GetOptions( 'h|help' => \my $help ); Whereas in Python you would see: parser.add_option('-h','--help',meta="HELP",target="HELP", help="Print help message",action="store_true",default=False)