Re: python3 package import difference?

Liste des GroupesRevenir à cl python 
Sujet : Re: python3 package import difference?
De : rosuav (at) *nospam* gmail.com (Chris Angelico)
Groupes : comp.lang.python
Date : 08. Aug 2024, 00:43:54
Autres entêtes
Message-ID : <mailman.32.1723070648.2890.python-list@python.org>
References : 1 2
On Thu, 8 Aug 2024 at 03:40, Tobiah via Python-list
<python-list@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

Date Sujet#  Auteur
7 Aug 24 * python3 package import difference?5Tobiah
7 Aug 24 +- Re: python3 package import difference?1Stefan Ram
8 Aug 24 +- Re: python3 package import difference?1Ronaldo Sc
8 Aug 24 +- Re: python3 package import difference?1Chris Angelico
8 Aug 24 `- Re: python3 package import difference?1Cameron Simpson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal