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
Remove namedtuple inheritance #93
Conversation
@@ -83,7 +82,26 @@ class VersionInfo(collections.namedtuple( | |||
:param str prerelease: an optional prerelease string | |||
:param str build: an optional build string | |||
""" | |||
__slots__ = () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So now VersionInfo is a mutable object with dynamic attrs. That's quite too dramatic change in the name of pretty printting pandas dataframes /:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR to make VersionInfo immutable (without inheriting from namedtuple) is highly appreciated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what's wrong with "namedtuple" approach? (Apart from problems with printing in Pandas)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing else than Pandas printing but that's quite problematic as it won't be solved soon (my 2 cts)
Some tests to ensure that VersionInfo are immutable should be added if mutability of VersionInfo is a problem
It seems this change broke backwards compatibility, because VersionInfo is not iterable anymore. See maartenbreddels/releash#2 or https://travis-ci.org/maartenbreddels/releash/jobs/439551331 , which worked 7 months ago with semver 2.7.9, but fails now with 2.8.1. Ironic this happened in the |
@hugobuddel agree, but we didn't have a test case for this scenario. I'll look on this issue. As workaround you may use: |
VersionInfo from semver 2.8.1 is not iterable, see python-semver/python-semver#93
Thanks @ppkt! It seems okay to have this change in a minor version increase because it was supposed to be backwards compatible. The old behavior could be considered undocumented and/or the new behavior can be seen as a bug and be fixed on a patch level (which you just did). Thanks for fixing it so quickly. I've just written out the list, so that code works with all versions of semver. |
Closes #87
Closes #94