[
https://issues.apache.org/jira/browse/THRIFT-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695531#action_12695531
]
David Reiss commented on THRIFT-335:
------------------------------------
The most immediate thing I notice is the same bug as in the C++ protocol.
{code}
+def makeZigZag(n, bits):
+ return (n << 1) ^ (n >> (bits - 1))
{code}
I can't find a way to do an arithmetic right shift in Python in general, but (N
>> (bits -1)) is a special case. It is zero if N is nonnegative and ~0 if N is
negative.
> Compact Protocol for Python
> ---------------------------
>
> Key: THRIFT-335
> URL: https://issues.apache.org/jira/browse/THRIFT-335
> Project: Thrift
> Issue Type: Sub-task
> Components: Library (Python)
> Reporter: Bryan Duxbury
> Priority: Trivial
> Attachments: thrift-compact-python-v1.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.