Get reference to parent class from subclass?

Prasad, Ramit ramit.prasad at
Tue Aug 30 23:26:24 CEST 2011

-----Original Message-----
From: at [ at] On Behalf Of John O'Hagan
Sent: Saturday, August 27, 2011 11:00 PM
To: python-list at
Subject: Get reference to parent class from subclass?

class P():

class C(P):

Can I get P from C? 

IOW, can I get a reference to the object P from the object C? This should be obvious one way or the other, but I haven't been able to find the answer.



You should be able to access what you need via the super() built-in. I am not entirely sure what you are trying to do...but I think usage of super is probably better than trying to access the base classes manually.


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at  

More information about the Python-list mailing list