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

Expand flipped object forwarding in lib.wiring to respect @property and del #968

Merged

Conversation

whitequark
Copy link
Member

@whitequark whitequark commented Nov 26, 2023

Although @property is the most common case, any descriptors are now properly supported.

The special casing of methods goes away as they work by having functions implement the descriptor protocol. (__get__ has some special behavior to make this possible.)

@whitequark whitequark added this to the 0.4 milestone Nov 26, 2023
Copy link

codecov bot commented Nov 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (89d1c9b) 83.68% compared to head (c58eb65) 83.72%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #968      +/-   ##
==========================================
+ Coverage   83.68%   83.72%   +0.03%     
==========================================
  Files          54       54              
  Lines        7766     7809      +43     
  Branches     1905     1912       +7     
==========================================
+ Hits         6499     6538      +39     
- Misses       1058     1061       +3     
- Partials      209      210       +1     

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

@whitequark whitequark force-pushed the wiring-descriptor-forwarding branch from df480b8 to 48fed8e Compare November 26, 2023 12:20
@whitequark whitequark marked this pull request as ready for review November 26, 2023 12:21
@whitequark whitequark force-pushed the wiring-descriptor-forwarding branch from 48fed8e to 58aeb8e Compare November 26, 2023 12:22
amaranth/lib/wiring.py Outdated Show resolved Hide resolved
…nd `del`.

Although `@property` is the most common case, any descriptors are now
properly supported.

The special casing of methods goes away as they work by having functions
implement the descriptor protocol. (`__get__` has some special behavior
to make this possible.)

This is some of the most cursed code I have ever written, yet it is
obviously necessary.
@whitequark whitequark force-pushed the wiring-descriptor-forwarding branch from 58aeb8e to c58eb65 Compare November 26, 2023 12:48
@whitequark whitequark enabled auto-merge November 26, 2023 12:49
@whitequark whitequark added this pull request to the merge queue Nov 26, 2023
Merged via the queue into amaranth-lang:main with commit 74e613b Nov 26, 2023
14 checks passed
@whitequark whitequark deleted the wiring-descriptor-forwarding branch November 26, 2023 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants