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

LLVM objects should implement __repr__ #48

Open
cgranade opened this issue Feb 8, 2022 · 1 comment
Open

LLVM objects should implement __repr__ #48

cgranade opened this issue Feb 8, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@cgranade
Copy link
Contributor

cgranade commented Feb 8, 2022

When printing out pyqir_parser objects at the console or in a notebook, the default object.__repr__ implementation is used, making it hard to understand output without further processing:

image

It would be good if parser objects supported __repr__ to provide more useful diagnostic output in such contexts.

@bamarsha bamarsha added this to the v0.7.0 milestone Oct 27, 2022
@bamarsha bamarsha removed this from the v0.7.0 milestone Nov 22, 2022
@bamarsha
Copy link
Contributor

Value (and its subtypes, including Function, BasicBlock, Instruction, etc.) now has __str__ which prints the LLVM IR text. It's not as obvious to me what to do for __repr__, since there is no string that can reproduce the object when run through Python eval.

@bamarsha bamarsha changed the title Parser objects should support__repr__ and __str__ LLVM objects should implement __repr__ Nov 22, 2022
@bamarsha bamarsha added the enhancement New feature or request label Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants