-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unload decorated classes before reloading decorators
Loading decorators within `to_prepare` with `prepend` or `include` ends up adding multiple copies of the decorator to the ancestors of the decorated class. This typically causes trouble when using `super` within methods or when changes done in `prepended` or `included` are not idempotent. Clearing dependencies also solves problems related to overwriting constants and removed methods (i.e. when a method is removed by a decorator, previous instances of the decorator that are still in the ancestors list will still have that method defined and will intercept calls to it).
- Loading branch information
Showing
2 changed files
with
19 additions
and
2 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
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