Skip to content

Conversation

@pvktk
Copy link
Owner

@pvktk pvktk commented May 31, 2018

No description provided.

Copy link

@yurii-litvinov yurii-litvinov left a comment

Choose a reason for hiding this comment

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

В целом всё правильно, зачтена


### grep

Для работы grep выбрана стандартная библиотека Питона для работы с регулярными выражениями re, потому что она хорошо работает и не приходится доставлять никакие зависимости.

Choose a reason for hiding this comment

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

Но не написано, какие ещё библиотеки были рассмотрены. Похоже на "золотой молоток", хотя в случае с Питоном действительно всё просто.

nlines = 0
if arglist.count('-A') > 0:
idx = arglist.index('-A')
snum = arglist[idx+1]

Choose a reason for hiding this comment

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

Надо пробелы вокруг бинарных операторов

nlines = 0
if arglist.count('-A') > 0:
idx = arglist.index('-A')
snum = arglist[idx+1]

Choose a reason for hiding this comment

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

И тут бы ещё неплохо проверять, что такой индекс вообще существует, иначе на grep -A хоть и не падает, но ругается довольно странно.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants