Skip to content

closured function fails with RecursionError #211

@mmckerns

Description

@mmckerns

Originally reported by @jetheron in #129.

import dill

def foo():
    def _foo():
        if not hasattr(_foo, '_counter'):
            _foo._counter = 0
        _foo._counter += 1
        return _foo._counter
    return _foo

f = foo()
f()
f()
dill.dumps(f)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions