[Python-ideas] Security: remove "." from sys.path?

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Jun 3 20:16:36 EDT 2017


Soni L. wrote:
> How about `import self.thing` (where "self" implies same dir as the 
> current .py

That wouldn't provide quite the same functionality, since
currently a module alongside the main py file can be imported
from anywhere, including .py files inside a package.

Also I think it would be confusing to have two very similar
but subtly different relative import mechanisms.

-- 
Greg


More information about the Python-ideas mailing list