python3 package import difference?

Chris Angelico rosuav at gmail.com
Wed Aug 7 18:43:54 EDT 2024


On Thu, 8 Aug 2024 at 03:40, Tobiah via Python-list
<python-list at python.org> wrote:
> The one under rcs.dbi contains:
>
>      from dbi import *
>      from regos import *
>

You probably want these to be package-relative now:

from .dbi import *
from .regos import *

Or, since you're using namespaced imports anyway ("rcs.dbi.feature"),
you may prefer this form:

from . import dbi, regos

ChrisA


More information about the Python-list mailing list