2017-03-18から1日間の記事一覧
入門Python3 6.10 classmethodデコレータを使うと、クラスメソッドを作ることができます。 class Foo(): def hello(): return "hello foo" @classmethod def hello_print (cls): print(cls.hello()) Foo.hello_print() $ py main.py hello fooclsにはFooクラ…
入門Python3 6.10 classmethodデコレータを使うと、クラスメソッドを作ることができます。 class Foo(): def hello(): return "hello foo" @classmethod def hello_print (cls): print(cls.hello()) Foo.hello_print() $ py main.py hello fooclsにはFooクラ…