Files
LangChainPractice/or_pipe.py
T

16 lines
382 B
Python

from typing import Callable
class Caller :
def __init__(self, ):
pass
def __or__(self, callable: Callable) :
return callable()
def __and__(self, callable: Callable):
return callable()
if __name__ == "__main__":
caller = Caller()
caller | (lambda: print("That should be printed"))
caller & (lambda: print("That should be printed"))