-
Notifications
You must be signed in to change notification settings - Fork 28
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
Alina Layeuskaya #47
base: master
Are you sure you want to change the base?
Alina Layeuskaya #47
Conversation
This reverts commit 36f1a91.
|
||
def main(): | ||
parser = create_parser() | ||
namespace = parser.parse_args(argv[1:]) |
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.
Зачем использовать sys.argv
? ArgumentParser сам знает об аргументах командной строки.
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.
Согласна. args = parser.parse_args()
import re | ||
import builtins | ||
|
||
from config import * |
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.
Импорт через звездочку -- это зло
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.
Согласна. from config import (LETTERS, DIGITS, ....)
# it's more convenient to do it here in order to simplify parsing to tokens | ||
if '..' in formula_string: | ||
print('ERROR: Number can not contain more than one delimiter "." !') | ||
was_error = True |
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.
Вместо флагов лучше использовать исключения
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.
Согласна про исключения и флаги. Не совсем понятно, какие исключения будут возбуждаться здесь, когда идут проверки на разделитель, неправильные операторы и т. д.
|
|
No description provided.