-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Python Support #18
Python Support #18
Conversation
@mr2rm Thanks a lot for the PR! I'm very happy to see contributions from others 😄 |
Don't mention it :)) |
Okay, it appears you did not work on the latest master. Can you please rebase onto the latest master and fix any merge conflicts? $ git fetch origin
$ git rebase origin/master Now you will get come merge conflicts. Fix each of the conflicted file, after fixing the conflict, use
After doing this for all the files, do
Then, to push them to the PR, do
This will remove the unnecessary extra commits. |
I've already merged |
That's exactly the problem - in this codebase, we use rebase, so if you merge, it will create extra commits. Don't worry, it's not a big deal. Let me know if you face any problems fixing this. |
I think you should also delete those two merge commits - b94742ed9a331c6f9ac0b62fac62ab5b92ca5ac3 and 2bbdbb0efc65bde352794561d895c56ce8f3c20b. (using interactive rebase). |
I've deleted those two commits both from
Do you mean |
Whatever's the name of the branch that points to this repo. Yeah, most likely |
@agrawal-d Rebase issues has just resolved and it's ready to review. I think everything is OK. Tell me if there was any other problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! A few comments below.
@mr2rm I replied to your comments. |
Let me know when you're done with making the changes so that I can merge this PR. |
@agrawal-d At first impression I wanted to separate
Any other options? Which one do you prefer? |
I prefer 1, i.e. Only |
@agrawal-d I agree with you and Python 2 will be deprecated soon 😄 |
Right now we don't do anything if |
@agrawal-d What about to store |
Good idea. I agree with you again 😄 |
Why are we even generating the bytecode for Python? Let's just skip compilation for python and only run the interpreter to evaluate. |
We can do it but I prefer to generate bytecode for better performance. What's wrong with move bytecode to |
@agrawal-d Did you notice my comment? |
There is no performance benefit for executing a bytecode, it only helps in reducing the compilation time when the same file is executed again.[1] I suggest that you skip the bytecode generation for Python and directly execute it. [1] See http://effbot.org/pyfaq/can-python-be-compiled-to-machine-code-c-or-some-other-language.htm & https://docs.python.org/3/glossary.html#term-bytecode |
I call it performance, not execution performance; I mean compilation performance.
I agree with above part of the first article which you mentioned. First of all implemented solutions are usually short and also each problem has a few testcases. So bytecode generation cost is not expensive and we can ignore it. |
@mr2rm are you done with the changes? |
Yep, It's ready to review. Let's check it! |
This commit marks the final one to bring in support for Python3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the revisions. I've pushed a small commit on top with some revisions, including those mentioned in the comments below.
Merged! Thanks for working on this. The refactors you made really improve the quality of the code! I'll add your name to the README to show your contribution! |
Thanks, I’m glad I could help. 😄
It's so kind of you. 🙏 |
Today! |
Also don't forget to mention Python in the Dependencies. |
Hi,
Recently after a long time away from competitive programming, I'v decided solving some programming challenges everyday. So I searched for the available tools which I can use to do it better and have more fun. Finally I've found the
competitive-programming-helper
useful to test my solutions.Yesterday, I've tried
competitive-programming-helper
in CodeForces contest and I had to solve problems only with C and C++. Since I'm a Python lover (of course beside C++ and JavaScript) and I use it a lot to solve my daily challenges, I decided to equip it to Python.So because it's the starting point of support multi languages, I made some fundamental changes to take effect. Here are my changelogs:
QuickPick
to get the user-selected language (C, C++ and Python).py
as a valid extension (e.g. keybindings, source creator, test runners and etc.)Any feedback and response would be appreciated. Also I hope these changes will be useful and could help everybody who wants to improve his problem solving paradigm.