Reimplement POEntry.__eq__
method, based on __cmp__
#107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I've just come across a problem while trying to extract messages from a Pyramid web app using Mako (1.1.5) templates. As per the Pyramid tutorial, I use Lingua (4.1.4) to extract messages. The error message was:
Basically,
pot-create
tries to determine if the catalog needs to be updated, by comparing all entries between the existing catalog and the new one. Now, inpolib
, testing if two entries are equal is ultimately done via the__cmp__
method, which uses<
and>
operators for comparison.The problem arises as the
msgstr_plural
fields returned by the Lingua extractor can be dicts, and so the<
and>
operators no longer apply. Comparing dict equality needs to be done diferently. In this version, I've reimplemented the__eq__
method so that it only uses!=
operators.Polib tests all succeed, to the change doesn't seem to break anything. The only thing that bothers me is code redundancy...
Laurent.