Closed GolfingSuccess closed 7 months ago
I had disabled this exact case for some reason because it was causing some parsing inconsistencies and I didn't think anyone was using it, but reenabling it now doesn't seem to break any tests anymore, and I don't think this is super confusing or anything, so I'll bless this syntax as allowed. This should be reenabled as of coconut-develop>=3.0.4-post_dev16
(pip install -U coconut-develop>=3.0.4-post_dev16
to get the fix).
Ah, well to be fair I've come across it due to code golf, so I'm not the perfect example of "everyday usage"... 😂 Thanks a lot!!!
This snippet doesn't work as I'd expect it to:
I would expect it to print
1
; instead, it fails like this:An interesting behavior appears if I try it in the REPL:
Notice the empty line above the error: it actually waited for me to "continue" writing, so I just pressed Enter and the error appeared.
If I add parentheses, as in
print(('abc').find x)
orprint(('abc'.find) x)
, it does print1
.Edit: This blocking behavior also occurs if I type something nonsensical, like
('abc'.'find') x
, or just'abc'.'find'
(that last one spits aCoconutSyntaxWarning
before blocking, but then fails anyway).