Permalink
Browse files

Made _AltRecord into ABC.

  • Loading branch information...
1 parent 2b85497 commit cc894c5961055e679e930c49da0fabeee13846bd Lenna Peterson committed Jul 1, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 vcf/model.py
View
@@ -1,3 +1,4 @@
+from abc import ABCMeta, abstractmethod
import collections
import sys
@@ -408,13 +409,15 @@ def is_monomorphic(self):
class _AltRecord(object):
'''An alternative allele record: either replacement string, SV placeholder, or breakend'''
+ __metaclass__ = ABCMeta
def __init__(self, type):
#: String to describe the type of variant, by default "SNV" or "MNV", but can be extended to any of the types described in the ALT lines of the header (e.g. "DUP", "DEL", "INS"...)
self.type = type
+ @abstractmethod
def __str__(self):
- assert False, "_AltRecord is an abstract class, you should be using a subclass instead"
+ raise NotImplementedError
def __eq__(self, other):
return self.type == other.type

0 comments on commit cc894c5

Please sign in to comment.