Skip to content

Conversation

gnattishness
Copy link

Period can raise an AttributeError when being compared with other types.

e.g.

>>> import pendulum
>>> p = pendulum.now() - pendulum.yesterday()
>>> p == None
AttributeError: 'NoneType' object has no attribute 'start'
>>> # should return False

This fix retains the same duck-typing capabilities, but using isinstance() is another option.

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.

1 participant