Skip to content

Conversation

@cqc-alec
Copy link
Collaborator

@cqc-alec cqc-alec commented Dec 4, 2025

The way TypeBounds are represented in string representations such as

"FuncDefn(f_name='__neg__', inputs=[Tuple(Opaque(id='float64', bound=<TypeBound.Copyable: 'C'>, args=[], extension='arithmetic.float.types'),)], params=[], visibility='Private')"

is somewhat annoying. This PR implements a custom __repr__() that makes it eval()-able.

@cqc-alec cqc-alec changed the title feat: Implement a custom TypeBound.__repr__(). feat (hugr-py): Implement a custom TypeBound.__repr__(). Dec 4, 2025
@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.36%. Comparing base (ff903be) to head (ff5ac86).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2727   +/-   ##
=======================================
  Coverage   83.36%   83.36%           
=======================================
  Files         267      267           
  Lines       52503    52505    +2     
  Branches    47214    47214           
=======================================
+ Hits        43770    43773    +3     
+ Misses       6355     6354    -1     
  Partials     2378     2378           
Flag Coverage Δ
python 88.77% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cqc-alec cqc-alec changed the title feat (hugr-py): Implement a custom TypeBound.__repr__(). feat(hugr-py): Implement a custom TypeBound.__repr__(). Dec 4, 2025
@cqc-alec cqc-alec marked this pull request as ready for review December 4, 2025 11:03
@cqc-alec cqc-alec requested a review from a team as a code owner December 4, 2025 11:03
@cqc-alec cqc-alec requested a review from mark-koch December 4, 2025 11:03
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

Successfully merging this pull request may close these issues.

2 participants