Skip to content

Conversation

@Hkoval
Copy link

@Hkoval Hkoval commented May 27, 2019

No description provided.

@Hkoval Hkoval changed the title [WIP] Hanna Kovalenok Hanna Kovalenok Jun 6, 2019
import pycalc.difcalc as difcalc
from numbers import Number
import importlib.util
from os import path
Copy link
Collaborator

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):
Copy link
Collaborator

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")
Copy link
Collaborator

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

Copy link
Collaborator

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("!)!))@))@)@)@))@)@)@)@)))))))")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем нужен такой принт?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants