Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AbstractPathEffect should implement deepcopy or frozen #3056

Closed
@gdowding

Description

@gdowding

I hit this while working on yhat/ggpy#288

AbstractPathEffect is composed of subclass of TransformNode which raises an exception during deepcopy() with the suggestion to use frozen(), but there is no frozen() in AbstractPathEffect.

from matplotlib.patheffects import AbstractPathEffect
from copy import deepcopy
ape = AbstractPathEffect()
deepcopy(ape)

...
    121         raise NotImplementedError(
    122             "TransformNode instances can not be copied. " +
--> 123             "Consider using frozen() instead.")
    124     __deepcopy__ = __copy__
    125 

but,

ape.frozen()
AttributeError: 'AbstractPathEffect' object has no attribute 'frozen'

I'm not familiar with TransformNode, so this may be a naive question, but why not implement __deepcopy__ as frozen() in that class?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions