semantics of __module__

后端 未结 2 663
不思量自难忘°
不思量自难忘° 2021-01-01 17:42

I\'m dynamically defining functions in a module and then updating the module\'s __all__ and the function\'s __name__ attribute to match the name it

2条回答
  •  时光取名叫无心
    2021-01-01 18:08

    You shouldn't have to worry about __module__ usually, sometimes its used for dark magic or knowing where a function came (example) debugging from, but most of the time everyone ignores it. If your really worried set __module__ = "dynamically_defined_function" or something similar.

提交回复
热议问题