operatorequals/httpimport

What does modules parameter is used for?

zhqu1148980644 opened this issue · 4 comments

self.module_names = modules

For my case, the codes below also work though I didn't specify modules

import httpimport
url = "https://gist.githubusercontent.com/zhqu1148980644/435304b90d1511099b070414c760e968/raw/e388a5ba1e3580eb9f4cb9e3061ab1f47210cf94"
with httpimport.remote_repo([], url):
       import task
task.task1("asdasd")

It is an old idea that should be deprecated.
Yet, deprecating it will make the module not backward compatible.

You are right though!

And also, if I change the link to link + task.py, the import would fail. What's the difference, they refer to the same content.

link

This happens as task.py is the module filename.
The filenames are automatically searched from the URL. Appending the specific module as a file won't work.

This issue can be closed