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

How to handle nested functions #104

Open
CJ-Wright-Citadel opened this issue May 14, 2021 · 1 comment
Open

How to handle nested functions #104

CJ-Wright-Citadel opened this issue May 14, 2021 · 1 comment

Comments

@CJ-Wright-Citadel
Copy link
Contributor

CJ-Wright-Citadel commented May 14, 2021

What do we do in this instance?

def f():
    def g():
        import abc
        return abc.xyz
   return g

# this doesn't need the imports
h = f()
# this needs the imports
k = h()

I don't think g is on the surface, since it is not accessible except inside f. But something needs to own the imports, since they may be real requirements. But those imports may be needed depending on if the returned function is called.

Currently we'd make a symbol modeule.f.g, which doesn't seem correct since f doesn't have attrs.

@CJ-Wright
Copy link
Member

CJ-Wright commented Jun 22, 2021

Example of this in the wild causing an error in the audit here from a bad entry here

I am making this comment solely in my personal capacity and am not conveying any rights to any intellectual property of any third parties.

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