Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Hanna Kovalenok #41

wants to merge 10 commits into from

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