The syntax import ..Submod refers to the name that is available within a parent module specified by the number of . dots, indicating how many levels up the module hierarchy to go. However, when it comes to package loading, it seems to work regardless of the number of dots. This inconsistency in behavior when loading as a script versus loading as a package is quite subtle, and ideally, there should be consistency. For now, in report_package, adjust modpath here to mimic the package loading behavior.
The syntax
import ..Submod
refers to the name that is available within a parent module specified by the number of.
dots, indicating how many levels up the module hierarchy to go. However, when it comes to package loading, it seems to work regardless of the number of dots. This inconsistency in behavior when loading as a script versus loading as a package is quite subtle, and ideally, there should be consistency. For now, inreport_package
, adjustmodpath
here to mimic the package loading behavior.