allpy
diff allpy/base.py @ 310:9ad22a1848fc
Added calls to super to all classes in allpy.base
The calls are not exactly correct.
This WILL fail in certain inheritance situations.
There are two bad situations:
* inheritance from object; __init__ of object does not accept any arguments,
so it is not compatible with interface of any of our classes
* inheritance of Block(Alignment). The situation here is relatively easy to
fix: we should force compatibility of function interfaces for Block and
Alignment.
author | Daniil Alexeyevsky <me.dendik@gmail.com> |
---|---|
date | Thu, 16 Dec 2010 21:08:03 +0300 |
parents | 0c3c1856113a |
children | 734db2702a5b |
line diff
1.1 --- a/allpy/base.py Thu Dec 16 20:47:09 2010 +0300 1.2 +++ b/allpy/base.py Thu Dec 16 21:08:03 2010 +0300 1.3 @@ -36,6 +36,7 @@ 1.4 instance_type = None 1.5 1.6 def __init__(self, name="", code1="", code3="", is_modified=False): 1.7 + super(MonomerType, self).__init__() 1.8 self.name = name.capitalize() 1.9 self.code1 = code1.upper() 1.10 self.code3 = code3.upper() 1.11 @@ -106,6 +107,7 @@ 1.12 monomer_type = MonomerType 1.13 1.14 def __init__(self, type): 1.15 + super(Monomer, self).__init__() 1.16 self.type = type 1.17 1.18 @classmethod 1.19 @@ -358,6 +360,7 @@ 1.20 In both cases we use exactly the list used in alignment, thus, if new 1.21 sequences or columns are added to alignment, the block tracks this too. 1.22 """ 1.23 + super(Block, self).__init__() 1.24 if sequences is None: 1.25 sequences = alignment.sequences 1.26 if colums is None: