Thrift: Native-code Binary Protocol encoder.

Summary:
Merging a patch from Ben Maurer.
This adds a python extension (i.e., a C module) that
encodes Python thrift structs into the standard binary protocol
much faster than our generated Python code.

Also added by-value equality comparison to thrift structs
(to help with testing).

Cleaned up some trailing whitespace too.

Reviewed By: mcslee, dreiss

Test Plan:
Recompiled Thrift.
Thrifted a bunch of IDLs and compared the generated Python output.
Looked at the extension module a lot.
test/FastBinaryTest.py

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665224 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/py/setup.py b/lib/py/setup.py
index 8ff1645..582a985 100644
--- a/lib/py/setup.py
+++ b/lib/py/setup.py
@@ -6,7 +6,11 @@
 # See accompanying file LICENSE or visit the Thrift site at:
 # http://developers.facebook.com/thrift/
 
-from distutils.core import setup
+from distutils.core import setup, Extension
+
+fastbinarymod = Extension('thrift.protocol.fastbinary',
+                          sources = ['src/protocol/fastbinary.c'],
+                          )
 
 setup(name = 'Thrift',
       version = '1.0',
@@ -16,5 +20,6 @@
       url = 'http://code.facebook.com/thrift',
       packages = ['thrift', 'thrift.protocol', 'thrift.transport', 'thrift.server'],
       package_dir = {'thrift' : 'src'},
+      ext_modules = [fastbinarymod],
       )