-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CLOSED] Implementation of raw_input() #33
Comments
@trotterdylan Thank you for great and awesome review. I will try to fix it. |
@trotterdylan Updated! I fixed codes as you commented. Actually, about using grumpy.File object is not 100% same as you intended. I found the simpler way. PTAL |
@trotterdylan A lot of stuff!! I will do it as your comment. Thanks |
@trotterdylan Updated!! Please take a look. |
@trotterdylan Updated. PTAL |
@trotterdylan Updated. p.s Can I get good materials to know when to use |
@corona10 re: defer: It can be used like finally. But, like finally, it's only really useful if there are multiple possible paths for exiting the function or an exception (panic in Go) is raised. In this case, a panic is a fatal error so it doesn't really matter if we close things. The only time it's really important to run some code in the case of panic is if the panic may be handled somewhere (for the most part in the Grumpy code, we assume panic is fatal) or if you need to release some resource even in the event of a panic. Sometimes mutex falls into this category because it can otherwise cause a deadlock if not released. It's also good to guarantee that temp files are cleaned up. But otherwise, the possibility of panic is not usually a good reason to defer. |
@trotterdylan Thank you for review and great guide! I updated it and please take a look. Thanks to you, I learned about how Go works. |
@trotterdylan Updated!! PTAL |
@trotterdylan Thank you for reviewing long days :-) |
@corona10 very nice :) |
Closing as this was imported by mistake. Already closed on google#233 |
I implemented a simplified version of raw_input().
Please review on focusing these.
First, It might be not 100% compatible with CPython and pypy's raw_input().
and also need more implementation to handle error cases.
Second, I need some guide for writing unit test codes to check it is well working for raw_input().
I don't know how to test user's input from keyboard.
Third, prompt printing is slower when running with
go run *.go
so if you have solutions then please give me a feedback.Related PR= google#247
The text was updated successfully, but these errors were encountered: