-
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
Hanna Kovalenok #41
base: master
Are you sure you want to change the base?
Hanna Kovalenok #41
Conversation
import pycalc.difcalc as difcalc | ||
from numbers import Number | ||
import importlib.util | ||
from os import path |
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.
Порядок объявления импортов описан в PEP8
|
||
class CheckAndChange(): | ||
|
||
def do_all_changes(self, expr, module): |
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.
Для читаемости можно добавлять аннотации функций/методов
if not re.search(r'[0-9]+', expr): | ||
const = re.search(r'[A-ZAa-z]+', expr) | ||
if not const: | ||
raise Exception("No Numbers in expression") |
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.
Создание кастомных эксепшенов тоже улучшает читаемость кода
"==": lambda a, b: a == b, | ||
"<": lambda a, b: a < b, | ||
"!=": lambda a, b: a != b | ||
|
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.
Зачем такое количество пустых строк?
a = calculator.calculate(args.a) | ||
|
||
else: | ||
print("!)!))@))@)@)@))@)@)@)@)))))))") |
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.