diff -r bfdb995e8d7d Doc/c-api/object.rst --- a/Doc/c-api/object.rst Thu Sep 25 12:13:41 2014 -0400 +++ b/Doc/c-api/object.rst Tue Sep 30 17:08:00 2014 +0530 @@ -212,6 +212,38 @@ a depth-first fashion for *A* --- the presence of the :attr:`~class.__bases__` attribute is considered sufficient for this determination. +Another function, __base__ that is specific to Cpython and also exists in Jython and PyPy can also be used on a class inheriting from one or more classes. When such a class takes arguments in the correct order, then starting leftmost: +1. the first user-defined class that either inherits from the instance of a built-in type other than object or inherits from another user defined class (single or multiple inheritance) that does so +Or in the absence of the above class, +2. A built-in type that is not an object +Or in the absence of the above +3. the first user defined class that inherits either an object or derives from a class (directly or indirectly) that inherits an object +is the value returned by the __base__ function +Examples: +1. +>>> class A(object): pass +... +>>> class B(A): pass +... +>>> class C(int): pass +... +>>> class D(B,A,C): pass +... +>>> D.__base__ + +2. +>>> class D(B,A,int): pass +... +>>> D.__base__ + +3. +>>> class D(B,A): pass +... +>>> D.__base__ + + + + .. c:function:: int PyObject_IsSubclass(PyObject *derived, PyObject *cls) diff -r bfdb995e8d7d Lib/urllib/response.py --- a/Lib/urllib/response.py Thu Sep 25 12:13:41 2014 -0400 +++ b/Lib/urllib/response.py Tue Sep 30 17:08:00 2014 +0530 @@ -68,7 +68,7 @@ super(addinfourl, self).__init__(fp, headers) self.url = url self.code = code - + def getcode(self): return self.code