목록2022/08/28 (1)
규도자 개발 블로그
Elixir의 Pipe연산자(|>)를 파이썬에서쓰기 위한 발악
Elixir의 Pipe연산자(|>)를 파이썬에서쓰기 위한 발악 Airflow를 사용하다가 이런 생각을 했다. Airflow의 DAG는 원래는 비트연산자인 >>(rshift)를 이용해서 로 Task의존성을 명시해서 그것을 시각화하여 보여주곤 하는데 이걸 이용하면 Elixir에서처럼 Pipe연산자를 만들 수 있지 않을까..? 바로 작업에 착수했다. 일단은 class Add: def __init__(self, num: int): self.num = num def __rshift__(self, other: 'Add'): return Add(self.num + other.num) def __str__(self): return str(self.num) 이런 함수를 만들어서 num1 = Add(1) n..
Python/Python
2022. 8. 28. 12:52