Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
sname = "example" some_class.<sname>.do_stuff()
snameのサブクラスの名前ですsome_class。私の呼び出しで文字列を動的に参照することは可能some_class.example.do_stuff()ですか?
sname
some_class
some_class.example.do_stuff()
ビルトインを探していますgetattr():
getattr()
getattr(some_class, sname).do_stuff()