Skip to content

Function namespace preservation #466

@anivegesana

Description

@anivegesana

Continuing the discussion from #462 (comment)

Even cloudpickle's behavior is a little bit finicky and has some unintuitive behavior. I think that there are design decisions that need to be made with regards to how we handle global dictionaries and functions.

import cloudpickle

def f():
    global x
    x = 5

def g():
    global x
    x = 0
    f()
    assert x == 5


G, GG = cloudpickle.loads(cloudpickle.dumps((g, g.__globals__)))

G.__globals__ != GG # Seems odd

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