You cannot access it because it is Transcriptionnot defined at the time the statement is executed def.
def align_transcription(self,model,target=PHONE):
pass
will do the trick. The name is PHONEavailable in the namespace, which will become a class Transcriptionafter completion class.
, class - , . Python , , class, . , , type. , . , def.
class Foo(object):
a = 1
def foo(self):
print self.a
ns = {'a': 1, 'foo': foo},
Foo = type('Foo', (object,), ns)
def foo(self):
print self.a
Foo = type('Foo', (object,), {'a': 1, 'foo': foo})
, Foo Foo, Foo.a .