Timeline for How to call subclass methods in a superclass in Python
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 19, 2012 at 20:01 | comment | added | glglgl |
@ThePracticalOne Hard to read, but in your case, file2.py is not used at all. If you do testcase = TestCase() and testcase.execute(), it should work.
|
|
| Oct 19, 2012 at 18:03 | comment | added | ThePracticalOne | What if the classes are in separate modules? i.e. file2.py import file1 class TestCase(file1.TestBase): def execute(self): self.pass() file1.py class TestBase: def pass(self): print "PASS" testBase = TestBase() testBase.execute() | |
| Feb 3, 2012 at 9:31 | comment | added | glglgl | @Tichodroma Sorry, my fault. Should think while writing ;-) Corrected now. | |
| Feb 3, 2012 at 9:30 | history | edited | glglgl | CC BY-SA 3.0 |
added 1 characters in body
|
| Feb 3, 2012 at 9:18 | comment | added | user647772 |
Where does a come from? Where the method meth?
|
|
| Feb 3, 2012 at 9:17 | history | answered | glglgl | CC BY-SA 3.0 |