-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests passing; hatch fmt ok; types core/ ok
- Loading branch information
1 parent
d2f4f8b
commit 8361e84
Showing
16 changed files
with
117 additions
and
145 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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,10 +1,10 @@ | ||
# SPDX-FileCopyrightText: 2024-present Dylan Lukes <[email protected]> | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
from typing import Protocol, final, ClassVar | ||
from typing import ClassVar, Protocol, final | ||
|
||
from renkon.core.model import TraitId, TraitKind, TraitPattern, TraitSpec, TraitSketch | ||
from renkon.core.model.type import rk_numeric, rk_float, Type | ||
from renkon.core.model import TraitId, TraitKind, TraitPattern, TraitSketch, TraitSpec | ||
from renkon.core.model.type import Type, rk_float, rk_numeric | ||
|
||
|
||
class Trait(Protocol): | ||
|
@@ -35,10 +35,12 @@ def params(self) -> set[str]: | |
return set(self.pattern.params) | ||
|
||
def sketch(self, **kwargs: dict[str, Type]) -> TraitSketch: | ||
return TraitSketch.model_validate({ | ||
"trait": self.spec, | ||
"metavar_bindings": kwargs, | ||
}) | ||
return TraitSketch.model_validate( | ||
{ | ||
"trait": self.spec, | ||
"metavar_bindings": kwargs, | ||
} | ||
) | ||
|
||
|
||
@final | ||
|
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
Oops, something went wrong.