Skip to content

Not possible to deepcopy() a YANGBaseClass class #215

@unsignedint

Description

@unsignedint

I was attempting to build a "fluent" interface but had some trouble with using deepcopy()

>>> a = lacp_.lacp()
>>> b = copy.deepcopy(a)
...pyangbind/lib/yangtypes.py in __new__(self, *args, **kwargs)
   1127         def __new__(self, *args, **kwargs):
   1128             try:
-> 1129                 obj = base_type.__new__(self, *args, **kwargs)
   1130             except TypeError:
   1131                 obj = base_type.__new__(self)

...pyangbind/lib/yangtypes.py in __new__(self, *args, **kwargs)
    469                         break
    470                 if not passed:
--> 471                     raise ValueError("%s does not match a restricted type" % val)
    472 
    473             try:

ValueError: 0 does not match a restricted type

Not sure if its easy to solve this one, but I'm creating an issue to track it anyway :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions