These are chat archives for evhub/coconut

6th
Mar 2018
Coop
@Darkle
Mar 06 2018 09:06
Hi i have a question about using pipes with mypy. If I run the coconut repl with coconut --mypy and run 'hello' |> print it works as expected and prints hello to the terminal, but if I run print <| 'hello' it prints hello to the terminal, but I also get an error message from mypy saying:
saying:
c:\users\coop\.virtualenvs\python-script-create-folder-with-date-name-epj_t_re\lib\site-packages\coconut\stubs\__coconut__.pyi:58: error: Incompatible types in assignment (expression has type overloaded function, variable has type overloaded function)
Coop
@Darkle
Mar 06 2018 09:14
Just wondering if that's normal.
Elliott Indiran
@eindiran
Mar 06 2018 18:47
I am having trouble reproducing this
If you compile the code in two separate files do you get the same behavior for each?
ie when I have two files, one with print then the string and the other with the string and then print, they compile to identical code
diff print_hello.py hello_print.py
3c3
< # __coconut_hash__ = 0xb82e6485
---
> # __coconut_hash__ = 0x4d9ff8e6
Coop
@Darkle
Mar 06 2018 21:09
Yeah it does compile to identical code and the code does work, it's just that mypy complains about it in the terminal.
So I'm running coconut with coconut ./ --watch --strict --target sys --mypy and here is the output:
Compiling         app.coco ...
Compiled to       app.py .
c:\users\coop\.virtualenvs\python-script-create-folder-with-date-name-epj_t_re\lib\site-packages\coconut\stubs\__coconut__.pyi:58: error: Incompatible types in assignment (expression has type overloaded function, variable has type overloaded function)
It compiles fine, its just that I get a complaint from mypy and I was just wondering if that's normal.
Coop
@Darkle
Mar 06 2018 23:31
I switched to using mypy on its own with the compiled source and it seems to work fine, so I'll just stick with that. Thanks.