Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python: what is the purpose of using ( ) in python imports?

Tags:

python

I just saw the following

from flask_login import (LoginManager, login_required, login_user, 
                         current_user, logout_user, UserMixin)

in here

What is the purpose of using parenthesis () in import statement?

Why shall someone use parenthesis while we can live without it?

is it recommended?

like image 626
daydreamer Avatar asked Apr 06 '13 19:04

daydreamer


1 Answers

So the statement can wrap onto the next line.

See sections: 2.1.5. Explicit line joining and 2.1.6. Implicit line joining.

like image 168
Tyler MacDonell Avatar answered Oct 23 '22 05:10

Tyler MacDonell