Skip to content

How to handle nested functions #104

Open
@CJ-Wright-Citadel

Description

@CJ-Wright-Citadel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions