CiscoDevNet / ydk-gen

Generate model-driven APIs from YANG models
http://ciscodevnet.github.io/ydk-gen/
Apache License 2.0
135 stars 74 forks source link

Python 3 TypeError while initializing CRUDService class #1032

Closed ygorelik closed 3 years ago

ygorelik commented 3 years ago

Current Behavior

Getting Python 3 TypeError while initializing CRUDService class.

Steps to Reproduce

(venv) ygorelik@bionic:~/ydk-gen$ python
Python 3.6.9 (default, Oct  8 2020, 12:12:24) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ydk.services import CRUDService
>>> crud = CRUDService()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: ydk_.services.CRUDService.__init__() must be called when overriding __init__
>>> 

The issue does not appear with lower (required) version of pybind11, which is 2.1.1.

System Information

YDK-0.8.5 pybind11 (2.6.0)

ygorelik commented 3 years ago

Fixed with this commit.

valeriodigregorio commented 3 years ago

Previous commit didn't fix the issue @ygorelik. I still see the issue. I suggest:


class CRUDService(_CrudService):
  def __init__(self):
    super(CRUDService, self).__init__()    # Adding this line worked for me
    self._crud = _CrudService()
ygorelik commented 2 years ago

Fixed in release 0.8.5.