When writing a python package that includes resources such as sample data files, why is it necessary to have an __init__.py in the (sub)package? (Or is this only a pre-3.7 quirk?)
The current recommended way of accessing resources is using importlib.resources (or in pre-3.7 versions importlib_resources; rather than pkg_resources which had performance problems or __file__ manipulations which are fragile depending on distribution methods). However, this only detects resources in a package directory if there is an __init__.py file (which can be empty).
Python had long been moving away from requiring __init__.py files (e.g. Guido addressed controversy/pitchforks back at version 2.5), and now (since PEP420) omitting any empty __init__.py results in an implicit namespace package (and also permits splitting a single package among separate directories). But for some reason importlib_resources at least does not support this?