Skip to content

Inheritance issue #14

@kirankotari

Description

@kirankotari

Need to define write way of inheritance

> ncs_pycli
Your maagic object 'root -> (root)' is now prepared... go have some fun!
trans.compare() to see your current transaction
trans.apply() to commit
trans.revert() to revert changes
Maapi object can be found at m
You can restart the transaction and create a fresh root object by invoking new_trans:
In [1]: new_trans
new transaction created

In [1]: class A:
   ...:     x = 10
   ...:

In [2]: class B(A):
   ...:     def __init__(self):
   ...:         A.__init__(self)
   ...:

In [3]: b = B()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
~/.pyenv/versions/3.7.16/lib/python3.7/site-packages/ncs_pycli/ncs_pycli.py in <module>
----> 1 b = B()

~/.pyenv/versions/3.7.16/lib/python3.7/site-packages/ncs_pycli/ncs_pycli.py in __init__(self)
      1 class B(A):
      2     def __init__(self):
----> 3         A.__init__(self)
      4

NameError: name 'A' is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions