Skip to content

Conversation

@kleschenko
Copy link
Contributor

No description provided.

Copy link
Collaborator

@sdispater sdispater left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.

I gave some feedbacks as to how it could be improved.

Also, could you add tests that cover these changes?

:type value: int
"""
if value not in range(7):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would do:

if value not in cls._days:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

:type value: int
"""
if value not in range(7):
raise ValueError('Invalid day of the week value: {}'.format(value))
Copy link
Collaborator

Choose a reason for hiding this comment

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

The message could be just:

'Invalid day of the week: {}'.format(value)

@sdispater sdispater merged commit 9eb456b into python-pendulum:master Oct 31, 2016
@sdispater
Copy link
Collaborator

Thanks!

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.

2 participants