Make symmetric() turn bare methods into properties#159
Conversation
…ion, bump version, update changelog upgrade lock file
ed605db to
2e2d76d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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 (usingenum.propertyon Python 3.11+). - Refresh docs/examples/tests to use property-style access (
.labelinstead of.label()and remove redundant@property). - Bump project version to
2.7.0and 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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.
closes #153