]> jfr.im git - z_archive/twitter.git/commitdiff
Use closure magic to get over Python's fucked up inheritance of base types.
authorMike Verdone <redacted>
Thu, 24 Feb 2011 22:21:22 +0000 (23:21 +0100)
committerMike Verdone <redacted>
Thu, 24 Feb 2011 22:21:22 +0000 (23:21 +0100)
twitter/api.py

index 694d2c4d679ad7e4724ba4f0aaf3f504488243b7..19a561570463f0545674a01dff3b37c999dff866 100644 (file)
@@ -72,14 +72,15 @@ def wrap_response(response, headers):
     if response_typ is bool:
         # HURF DURF MY NAME IS PYTHON AND I CAN'T SUBCLASS bool.
         response_typ = int
-    class WrappedTwitterResponse(TwitterResponse, response_typ):
+
+    class WrappedTwitterResponse(response_typ, TwitterResponse):
         __doc__ = TwitterResponse.__doc__
 
-        def __init__(self, response, headers):
+        def __init__(self, response):
             response_typ.__init__(self, response)
             TwitterResponse.__init__(self, headers)
 
-    return WrappedTwitterResponse(response, headers)
+    return WrappedTwitterResponse(response)