Created
July 1, 2012 17:27
Revisions
-
Lenna Peterson created this gist
Jul 1, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ class _AltRecord(object): def __init__(self, alt_type, **kwargs): print "_AltRecord" super(_AltRecord, self).__init__(**kwargs) self.alt_type = alt_type class _Substitution(_AltRecord): def __init__(self, sequence, **kwargs): print "_Substitution" if len(sequence) == 1: super(_Substitution, self).__init__(alt_type="SNV", **kwargs) else: super(_Substitution, self).__init__(alt_type="MNV", **kwargs) self.sequence = sequence class _Unknown(object): def __init__(self, unknown=True, **kwargs): print "_Unknown" super(_Unknown, self).__init__(**kwargs) self.unknown = unknown class _UnknownSubs(_Unknown, _Substitution): def __init__(self, sequence, **kwargs): print "_UnknownSubs" super(_UnknownSubs, self).__init__(sequence=sequence, **kwargs) print self.sequence, self.alt_type, self.unknown def test(cl, **kwargs): print "MRO:", [x.__name__ for x in cl.__mro__] print "Calls:", cl(**kwargs) print if __name__ == "__main__": #test(_AltRecord, alt_type="x") #test(_Substitution, sequence="ATG") #test(_Unknown) test(_UnknownSubs, sequence="G")