__init__
Pythonクラスの先頭にある宣言は、 ?のステートメントと同等かどうか疑問に思いました。例えば
import sys
class bla():
print 'not init'
def __init__(self):
print 'init'
def whatever(self):
print 'whatever'
def main():
b=bla()
b.whatever()
return 0
if __name__ == '__main__':
sys.exit( main() )
出力は次のとおりです。
not init
init
whatever
補足として、今私はまた得ます:
Fatal Python error: PyImport_GetModuleDict: no module dictionary!
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
これがなぜであるかについてのアイデアはありますか?前もって感謝します!