Skip to content

Conversation

@pganssle
Copy link
Member

@pganssle pganssle commented Jan 2, 2020

Summary of changes

This was originally dead code, because an indentation error had __repr__ defined after the return statement in __str__. The definition of the __repr__ is also changed to be more in line with the conception of a repr as "what you would have to evalue to get this object".

Even though this is not guaranteed behavior, this commit also adds a regression test to avoid simple errors like this in the future.

Closes #991

Pull Request Checklist

  • Changes have tests
  • Authors have been added to AUTHORS.md
  • News fragment added in changelog.d. See CONTRIBUTING.md for details

@pganssle pganssle added this to the Bugfix release milestone Jan 2, 2020
@jbrockmendel
Copy link
Contributor

LGTM

@pganssle
Copy link
Member Author

pganssle commented Jan 2, 2020

Thanks for the review @jbrockmendel!

This was originally dead code, because an indentation error had `__repr__`
defined after the `return` statement in `__str__`. The definition of the
`__repr__` is also changed to be more in line with the conception of a
repr as "what you would have to evalue to get this object".

Even though this is not guaranteed behavior, this commit also adds a
regression test to avoid simple errors like this in the future.
@pganssle pganssle merged commit 110a09b into dateutil:master Jan 2, 2020
@pganssle pganssle modified the milestones: Bugfix release, 2.8.2 Jan 2, 2020
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.

ParserError custom __repr__ is not reached

2 participants