Get reference to parent class from subclass?
ramit.prasad at jpmorgan.com
Tue Aug 30 23:26:24 CEST 2011
From: python-list-bounces+ramit.prasad=jpmorgan.com at python.org [mailto:python-list-bounces+ramit.prasad=jpmorgan.com at python.org] On Behalf Of John O'Hagan
Sent: Saturday, August 27, 2011 11:00 PM
To: python-list at python.org
Subject: Get reference to parent class from subclass?
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 http://www.jpmorgan.com/pages/disclosures/email.
More information about the Python-list