pyteal
pyteal copied to clipboard
Getter method `byte_srt` of `Bytes`
Subject of the issue
Getter method byte_srt of Bytes returns a string containing quotation marks.
Your environment
pyteal: 0.10.1
Steps to reproduce
Bytes('foo').byte_str
Expected behaviour
'foo'
Actual behaviour
"'foo'"
Priority
Very low.
Hi, I think this trace back to the implementation in this line: https://github.com/algorand/pyteal/blob/master/pyteal/ast/bytes.py#L49, where escapeStr was called.
The escapeStr was implemented in https://github.com/algorand/pyteal/blob/master/pyteal/util.py, where the function returns string surrounded with double quotes.
I am not too sure of what was the motivation behind the design, but I can look into it and see what can be done. A quick fix for it is to use unescapeStr, which revert escaped-string back.