-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added behaviour for correct subclass initialization from json.
- Loading branch information
Showing
4 changed files
with
58 additions
and
16 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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.1.4' | ||
__version__ = '1.1.5' |
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,16 @@ | ||
def get_full_class_name(cls): | ||
""" | ||
Returns the full name of a class, including the module name. | ||
:param cls: The class. | ||
:return: The full name of the class | ||
""" | ||
return cls.__module__ + "." + cls.__name__ | ||
|
||
|
||
def recursive_subclasses(cls): | ||
""" | ||
:param cls: The class. | ||
:return: A list of the classes subclasses. | ||
""" | ||
return cls.__subclasses__() + [g for s in cls.__subclasses__() for g in recursive_subclasses(s)] |
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