Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to replace import * names with mod.name #11

Open
asmeurer opened this issue Aug 18, 2019 · 1 comment
Open

Add option to replace import * names with mod.name #11

asmeurer opened this issue Aug 18, 2019 · 1 comment

Comments

@asmeurer
Copy link
Owner

For example, replace

from numpy import *

def sin_cos(x):
    sin(cos(array(x)))

with

import numpy as np

def sin_cos(x):
    np.sin(np.cos(np.array(x)))

I'm not sure what the interface should look like.

@ItsCubeTime
Copy link

ItsCubeTime commented Jun 8, 2024

Please add this! Importing objects directly into global scope makes intellisense unusably slow for certain projects

Edit: could be a simple cmd line argument --import-module-instead-of-modules-contents .

Personally I dont use the as syntax a lot, so I dont really have a need for it, but I guess one could also do something like --import-as="numpy as np, taichi as ti"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants