-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@beartype
+ @classmethod
+ @property
.
This commit generalizes the `@beartype` decorator to be explicitly support decoration of **class properties** (i.e., methods decorated by a decorator chain consisting of `@beartype`, `@classmethod`, and `@property` in that exact order), resolving issue #278 kindly submitted by the mysterious GitHub avatar sporting a creepy 8-bit green pumpkin face known only as @empyrealapp. Note, however, that this support comes with a significant caveat: **Python 3.11.0 officially deprecated chaining the `@classmethod` decorator into the `@property` decorator.** Although this functionality still works under Python ≥ 3.11 *for the moment,* users are strongly advised to refactor such decorator chains into **metaclass properties** (i.e., methods defined on the metaclass of a class decorated by a decorator chain consisting of `@beartype` and `@property` in any arbitrary order). If you are now confused, you're not the only one. Stop deprecating things that work just fine for almost everybody, Python. Seriously. — Sincerely yours, everybody. (*Loosely elusive illusion!*)
- Loading branch information
Showing
5 changed files
with
323 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.