First, could you confirm the following syntax

import foo as f

equivalent to

import foo
f = foo



Now, I was wondering about the usefulness in everyday programming of the as syntax within an import statement. Here are some instances retrieved from real code of such a syntax

import numpy as np

import math as _math

import pickle as pickle


-- In the first case, the syntax is motivated by brevity need, isn't it ?
-- The second case seems to be rather widespread and causes math attribute to be private but I don't figure out why this matters.
-- In the last case, I can see no point

So what is the pragmatics of the as syntax ?

Thanks for clarification.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to