-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: ♻️ Renames some
Operation
to Operator
Renames the class `Operation` to `Operator` with some changes to "Operation" originally intended as "Operator" #43
- Loading branch information
1 parent
697e452
commit 5298484
Showing
16 changed files
with
94 additions
and
94 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
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
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,33 +1,33 @@ | ||
from typing import Callable, Dict | ||
from pynars.Narsese._py.Operation import * | ||
|
||
registered_operations: Dict[Operation, Callable] = {} | ||
registered_operators: Dict[Operator, Callable] = {} | ||
|
||
def registered_operation_names(): | ||
def registered_operator_names(): | ||
'''''' | ||
global registered_operations | ||
return [registered_operation.word for registered_operation in registered_operations.keys()] | ||
global registered_operators | ||
return [registered_operator.word for registered_operator in registered_operators.keys()] | ||
|
||
|
||
def register(operation: Operation, callable: Callable): | ||
def register(operator: Operator, callable: Callable): | ||
'''''' | ||
global registered_operations | ||
registered_operations[operation] = callable | ||
global registered_operators | ||
registered_operators[operator] = callable | ||
|
||
|
||
def is_registered_by_name(word): | ||
'''''' | ||
global registered_operations | ||
for registered_operation in registered_operations.keys(): | ||
if registered_operation.word == word: | ||
global registered_operators | ||
for registered_operator in registered_operators.keys(): | ||
if registered_operator.word == word: | ||
return True | ||
return False | ||
|
||
|
||
def get_registered_operation_by_name(word): | ||
def get_registered_operator_by_name(word): | ||
'''''' | ||
global registered_operations | ||
for registered_operation in registered_operations.keys(): | ||
if registered_operation.word == word: | ||
return registered_operation | ||
global registered_operators | ||
for registered_operator in registered_operators.keys(): | ||
if registered_operator.word == word: | ||
return registered_operator | ||
return 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
Oops, something went wrong.