algorand/pyteal

Operator overloading for Concat and Bytes

PabloLION opened this issue · 2 comments

Problem

Bytes('a') + Bytes('b') will report type check error because of this: https://github.com/algorand/pyteal/blob/master/pyteal/ast/expr.py#L72-L73

def __add__(self, other):
from pyteal.ast.naryexpr import Add

Solution

Bytes('a') + Bytes('b') returns Concat(Bytes('a'),Bytes('b')), or Bytes('ab')

Dependencies

Urgency

Ergonomic feature, not urgent.

dupe of #496