FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix custom repr for ParserError by pganssle · Pull Request #993 · dateutil/dateutil · GitHub

Fix custom repr for ParserError - #993

Merged
pganssle merged 1 commit into
dateutil:masterfrom
pganssle:parsererror_repr
Jan 2, 2020
Merged

pganssle merged 1 commit into
dateutil:masterfrom
pganssle:parsererror_repr

Conversation

pganssle commented Jan 2, 2020

Copy link
Copy Markdown
Member

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 added this to the Bugfix release milestone Jan 2, 2020

Copy link
Copy Markdown
Contributor

LGTM

pganssle commented Jan 2, 2020

Copy link
Copy Markdown
Member Author

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 merged commit 110a09b into dateutil:master Jan 2, 2020
pganssle modified the milestones: Bugfix release, 2.8.2 Jan 2, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL