kpvdr commented on a change in pull request #256:
URL: https://github.com/apache/qpid-proton/pull/256#discussion_r469510090
##########
File path: python/proton/_message.py
##########
@@ -90,13 +90,18 @@ def _check(self, err):
def _check_property_keys(self):
for k in self.properties.keys():
- if isinstance(k, unicode):
- # py2 unicode, py3 str (via hack definition)
+ # Check for string types. (py2: unicode, py3: str via type hack
above)
+ # or string subclasses. Exclude string subclasses symbol and char.
+ if isinstance(k, unicode) and not (type(k) is symbol or type(k) is
char):
+ # Convert string subclasses to string
+ if not type(k) is unicode:
+ self.properties[unicode(k)] = self.properties.pop(k)
continue
Review comment:
I think it is a way of jumping out of the code within the for loop and
continuing with the loop itself:
```
for k in self.property.keys():
if <k is unicode or its subclasses, excluding symbol and char>:
if <k is a subclass of unicode>:
<convert key to unicode>
continue
other stuff...
```
is a way of avoiding other stuff if xxx is true. But I am sure there is a
way of rearranging this to avoid it. Certainly it is not possible to replace
continue with pass, that is not logically the same, as other stuff would also
then be executed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]