-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from lmignon/master-refactor
Master refactor
- Loading branch information
Showing
6 changed files
with
50 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Access to the context variable used to store the current extended Classes | ||
returns None if no context is available. Previously the access to the context | ||
throws an exception if no context was available. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Calls to the classmethod "_get_assembled_cls" now raises RegistryNotInitializedError | ||
if the registry is not initialized. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The metadaclass now provides the method `_wrap_class_method`. This method | ||
can be used to wrap class methods in a way that when the method is called | ||
the logic is delegated to the aggregated class instance if it exists. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# define context vars to hold the extendable registry | ||
|
||
from contextvars import ContextVar | ||
from typing import TYPE_CHECKING | ||
from typing import TYPE_CHECKING, Optional | ||
|
||
if TYPE_CHECKING: | ||
from .registry import ExtendableClassesRegistry | ||
|
||
extendable_registry: ContextVar["ExtendableClassesRegistry"] = ContextVar( | ||
"extendable_registry" | ||
extendable_registry: ContextVar[Optional["ExtendableClassesRegistry"]] = ContextVar( | ||
"extendable_registry", default=None | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class RegistryNotInitializedError(Exception): | ||
pass |
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