def __new__(mcs, name, bases, attrs):
<EOL>cls = type.__new__(mcs, name, bases, attrs)<EOL>if not hasattr(cls, '<STR_LIT>'):<EOL><INDENT>cls.classes_by_rel_type = defaultdict(lambda: cls)<EOL><DEDENT>rt = attrs.get('<STR_LIT>', None)<EOL>if rt:<EOL><INDENT>cls.classes_by_rel_type[rt] = cls<EOL><DEDENT>return cls<EOL>
This is called when a new class is created of this type