def test_func():
print('call test_func')
class TestClass:
# メソッド
def test_method():
print('call test_method')
print('------------------------')
print(test_func)
print(TestClass.test_method)
print('------------------------')
print(type(test_func))
print(type(TestClass.test_method))
print('------------------------')
t = TestClass()
print(test_func)
print(t.test_method)
上記のコード実行時においてこのような結果が表示されるのですが、
<function test_func at 0x0000022A9E2E3E18> #(1)
<function TestClass.test_method at 0x0000022A9E82BAE8> #(2)
<class 'function'>
<class 'function'>
<function test_func at 0x0000022A9E2E3E18> #(3)
<bound method TestClass.test_method of <main.TestClass object at 0x0000022A9E82A0F0>> #(4)
(1)-(4)が何を示しているのかを教えていただけると嬉しいです。
よろしくお願いします
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/04/03 09:26