Skip to content

Make symmetric() turn bare methods into properties#159

Merged
bckohan merged 4 commits intomainfrom
symmetric_property
Mar 5, 2026
Merged

Make symmetric() turn bare methods into properties#159
bckohan merged 4 commits intomainfrom
symmetric_property

Conversation

@bckohan
Copy link
Owner

@bckohan bckohan commented Mar 5, 2026

closes #153

Copilot AI review requested due to automatic review settings March 5, 2026 07:42
…ion, bump version, update changelog upgrade lock file
@codecov-commenter
Copy link

codecov-commenter commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (02cd41a) to head (91f557f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #159   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          385       390    +5     
  Branches        84        86    +2     
=========================================
+ Hits           385       390    +5     

☔ 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates enum-properties so @symmetric() can be applied directly to bare methods (no @property required), with the decorated member behaving as a read-only property for symmetric lookups and type-checking.

Changes:

  • Update symmetric() to automatically wrap plain functions as properties (using enum.property on Python 3.11+).
  • Refresh docs/examples/tests to use property-style access (.label instead of .label() and remove redundant @property).
  • Bump project version to 2.7.0 and update lockfile dependencies.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/enum_properties/__init__.py Implements auto-wrapping of bare methods into properties within @symmetric().
src/enum_properties/__init__.pyi Updates typing for symmetric() to model property-like descriptors for better type inference.
tests/annotations/test_symmetric.py Updates runtime tests to assert property-style access for bare @symmetric() methods.
tests/type_hints/test.py Adds type-hint probes validating that bare @symmetric() methods resolve to typed attributes.
tests/examples/howto_symmetric_decorator.py Updates example to remove @property and use bare symmetric methods.
doc/source/howto.rst Documents the new “no @property required” behavior.
doc/source/changelog.rst Adds a v2.7.0 changelog entry for the behavior change.
pyproject.toml Bumps package version to 2.7.0.
uv.lock Updates locked dependency versions consistent with the release bump.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

bckohan and others added 2 commits March 4, 2026 23:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 5, 2026 08:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bckohan bckohan merged commit 4d04f08 into main Mar 5, 2026
26 checks passed
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.

Make @symmetric a property if it wraps a plain function.

3 participants