Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Version.__repr__() should return a Version() like string #15

Open
dl6nm opened this issue Aug 19, 2021 · 0 comments
Open

refactor: Version.__repr__() should return a Version() like string #15

dl6nm opened this issue Aug 19, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dl6nm
Copy link
Owner

dl6nm commented Aug 19, 2021

Implement a better representation of the both dunder methods __repr__ and __str__.

As summarized on Stack Overflow...

Implement __repr__ for any class you implement. This should be second nature. Implement __str__ if you think it would be useful to have a string version which errs on the side of readability.

So __repr__ should output something like this:

Version(major=1, minor=2, patch=3, prerelease=None, build='15-gbfc10a8-dirty')

And __str__ should output something like this:

1.2.3+15-gbfc10a8-dirty
@dl6nm dl6nm added the enhancement New feature or request label Aug 19, 2021
@dl6nm dl6nm self-assigned this Aug 19, 2021
@dl6nm dl6nm added this to the 0.3.0 milestone Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant