From: Mike Verdone Date: Thu, 24 Feb 2011 22:21:22 +0000 (+0100) Subject: Use closure magic to get over Python's fucked up inheritance of base types. X-Git-Tag: twitter-1.5~5 X-Git-Url: https://jfr.im/git/z_archive/twitter.git/commitdiff_plain/12bba6aca4b725865d8f411a86c299187a8c3223 Use closure magic to get over Python's fucked up inheritance of base types. --- diff --git a/twitter/api.py b/twitter/api.py index 694d2c4..19a5615 100644 --- a/twitter/api.py +++ b/twitter/api.py @@ -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)