-
Notifications
You must be signed in to change notification settings - Fork 27
Mariya Polyakova #44
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
base: master
Are you sure you want to change the base?
Mariya Polyakova #44
Conversation
…d for visual indent corrected, function which deletes whitespaces added.
|
||
|
||
def is_operand(token): | ||
if token.isdigit() or is_float(token): |
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.
Можно просто сделать return token.isdigit() or is_float(token)
func_name, func_attr_count = decode_func_attr_count(token) | ||
while func_attr_count > 0: | ||
if not stack: | ||
raise Exception("missing argument") |
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.
Можно создавать кастомные исключения. Такой подход делает код более читаемым
|
||
def is_token_basic_operator(token): | ||
exceptions = [')'] | ||
if token in exceptions: |
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.
Функция выглядит довольно странно. Какой смысл создавать список из одного значения и проверять входит ли аргумент в этот список? Не проще ли просто сравнить?
the final version of the code