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

Python import alias #2992

Closed
Isaac0616 opened this issue Apr 22, 2021 · 3 comments
Closed

Python import alias #2992

Isaac0616 opened this issue Apr 22, 2021 · 3 comments
Labels
alpha Relates to an experimental feature feature:matching stale needs prioritization; label applied by stalebot user:external requested by someone outside of r2c

Comments

@Isaac0616
Copy link
Contributor

Describe the bug
Not sure whether it is a bug, intended behavior, or should be a feature request.
For the pattern import $X.function, $X will only match one level of modules.
For example, it matches import x.function but not import x.y.function.
In contrast, for the pattern $X.function(...), $X would match multiple level of modules.
For example,

from x.y import function
import x.y.function

x.y.function()
function()

#1771 seems to be a relevant ticket.

To Reproduce
https://semgrep.dev/s/yz3A

Expected behavior
A way to match any level of modules.

@colleend colleend added feature:matching lang:python alpha Relates to an experimental feature and removed lang:python labels Apr 26, 2021
@colleend
Copy link
Contributor

Thanks for filing this issue! There has definitely been discussion about "import $X.function" matching cases such as "from x.y import function", and we agree that this makes sense. Another relevant ticket comment is #975 (comment). This would be a nice feature to have, although it's not currently high priority.

@nbrahms nbrahms added the user:external requested by someone outside of r2c label Apr 26, 2021
@stale
Copy link

stale bot commented Jul 25, 2021

This issue is being marked stale because there hasn't been any activity in 30 days. Please leave a comment if you think this issue is still relevant and should be prioritized, otherwise it will be automatically closed in 7 days (you can always reopen it later).

@stale stale bot added the stale needs prioritization; label applied by stalebot label Jul 25, 2021
@stale
Copy link

stale bot commented Aug 1, 2021

Stale-bot has closed this stale item. Please reopen it if this is in error.

@stale stale bot closed this as completed Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha Relates to an experimental feature feature:matching stale needs prioritization; label applied by stalebot user:external requested by someone outside of r2c
Development

No branches or pull requests

3 participants