The new diff looks much better. Thanks Hermann! I only have three more
comments :)
* I think we need a few more tests, especially for the edge cases. For
instance, what happens when you do:
msg1 = _('Message 1 and $msg2', mapping={})
msg1.mapping['msg2'] = _('Message 2 and $msg1', mapping={'msg1':
msg1})
I know, it's a bit of an edge case, but it should be dealt with.
* Copying the dictionary shouldn't be done with copy.copy. It can
easily be done with mapping.copy(). In other words, dictionaries have
a copy() method, you should use it.
* Style: Wrapping a long if-line is more nicely wrapped using
parantheses, rather than backspace. I suppose it's a matter of taste,
but PEP8 suggests using parantheses ("The preferred way of wrapping
long lines is by using Python's implied line continuation inside
parentheses, brackets and braces.").
The new diff looks much better. Thanks Hermann! I only have three more
comments :)
* I think we need a few more tests, especially for the edge cases. For
instance, what happens when you do:
msg1 = _('Message 1 and $msg2', mapping={}) mapping[ 'msg2'] = _('Message 2 and $msg1', mapping={'msg1':
msg1.
msg1})
I know, it's a bit of an edge case, but it should be dealt with.
* Copying the dictionary shouldn't be done with copy.copy. It can
easily be done with mapping.copy(). In other words, dictionaries have
a copy() method, you should use it.
* Style: Wrapping a long if-line is more nicely wrapped using
parantheses, rather than backspace. I suppose it's a matter of taste,
but PEP8 suggests using parantheses ("The preferred way of wrapping
long lines is by using Python's implied line continuation inside
parentheses, brackets and braces.").