These are chat archives for evhub/coconut

8th
Jan 2018
Evan Hubinger
@evhub
Jan 08 2018 21:28 UTC
@puruzio That's a result of #353. Coconut translates str[] to Iterable[str], not List[str], and str is a subtype of Iterable[str] (though not List[str]), since if you iterate over a str you do in fact get strs. Whether str[] should compile to List[str] instead is the question of that issue.
Jason O.
@puruzio
Jan 08 2018 21:37 UTC
This message was deleted
Jason O.
@puruzio
Jan 08 2018 21:44 UTC
Then is there a type annotation I can put in line 1 instead of str[] to specify it should be a list of str? List[str] doesn’t seem to work. Sorry if I missed it in #353
Evan Hubinger
@evhub
Jan 08 2018 23:20 UTC
@puruzio Just do:
try: from typing import List
except ImportError: pass
a: List[str] = ["a", "b"]