f"{f.__module__}.{f.__name__}"
doesn't work because function f
can be local, eg inside another function. We need to add some kind of marked ( .<local>.
) in the path to specify that this function is local. But how to determine when we need to add this marker?
使用f.__qualname__
而不是__name__
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.