This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
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.
Fix kwargs, repr, and remove double .__init__ call
- Loading branch information
1 parent
6b7906a
commit 6d1395e
Showing
2 changed files
with
55 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from sage.categories.sets_cat import Sets | ||
from sage.structure.unique_representation import UniqueRepresentation | ||
from sage.structure.list_clone import ClonableArray | ||
from sage.structure.parent import Parent | ||
from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass | ||
|
||
class Diagram(ClonableArray, metaclass=InheritComparisonClasscallMetaclass): | ||
@staticmethod | ||
def __classcall_private__(cls, cells): | ||
return Diagrams()(cells) | ||
|
||
def __init__(self, parent, cells): | ||
self._cells = {c: True for c in cells} | ||
ClonableArray.__init__(self, parent, cells) | ||
|
||
def check(self): | ||
pass | ||
|
||
class Diagrams(UniqueRepresentation, Parent): | ||
def __init__(self): | ||
Parent.__init__(self, category=Sets()) | ||
|
||
def _element_constructor_(self, cells): | ||
return self.element_class(self, cells) | ||
|
||
Element = Diagram |