Remove namedtuple inheritance#93
Remove namedtuple inheritance#93s-celles merged 1 commit intopython-semver:masterfrom s-celles:no_named_tuple
Conversation
| :param str prerelease: an optional prerelease string | ||
| :param str build: an optional build string | ||
| """ | ||
| __slots__ = () |
There was a problem hiding this comment.
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.
PR to make VersionInfo immutable (without inheriting from namedtuple) is highly appreciated
There was a problem hiding this comment.
But what's wrong with "namedtuple" approach? (Apart from problems with printing in Pandas)
There was a problem hiding this comment.
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