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

python: AttrObject member functions not available in derived classes #1020

Open
pumbor opened this issue May 20, 2019 · 1 comment
Open

python: AttrObject member functions not available in derived classes #1020

pumbor opened this issue May 20, 2019 · 1 comment

Comments

@pumbor
Copy link

pumbor commented May 20, 2019

Preface

In yosys's C++ class hierarchy, several classes derive from AttrObject so that they have access to a common set of attribute getters/setters. A python wrapper is generated for AttrObject, but the wrappers for the derived classes don't include the inheritance information to enable the derived classes to use the AttrObject functions.

Steps to reproduce the issue

cd yosys/examples/python-api
python3 -i script.py
design.top_module().get_src_attribute()

Expected behavior

In python, wrapped derived classes can use AttrObject methods to get to attributes.

Actual behavior

In python, wrapped derived classes of AttrObject cannot access AttrObject methods:

>>> design.top_module().get_src_attribute()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Module' object has no attribute 'get_src_attribute'
@cliffordwolf
Copy link
Collaborator

cc @btut

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