Reputation: 627
Can I import module in Python giving it two or more aliases in one line?
With two lines this works:
from time import process_time as tic
from time import process_time as toc
This doesn't work, but I would want to be able to write something like:
from time import process_time as tic,toc
Upvotes: 18
Views: 8975
Reputation: 4250
You can do that with
from time import process_time as tic, process_time as toc
Upvotes: 33