Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to deepcopy() a YANGBaseClass class #215

Open
unsignedint opened this issue Jun 17, 2018 · 1 comment
Open

Not possible to deepcopy() a YANGBaseClass class #215

unsignedint opened this issue Jun 17, 2018 · 1 comment

Comments

@unsignedint
Copy link
Contributor

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 :-)

@JoseIgnacioTamayo
Copy link
Collaborator

Hi,

Could you please try again with a recent / latest release of pyangbind?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants