Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > fr.comp.lang.python > #3210
| Newsgroups | fr.comp.lang.python |
|---|---|
| Date | 2019-07-14 06:10 -0700 |
| References | <5d2911c7$0$31401$426a34cc@news.free.fr> |
| Message-ID | <6d5aca45-abc5-40ac-97a5-5cd5dc84e173@googlegroups.com> (permalink) |
| Subject | Re: from matplotlib import pyplot as * ? |
| From | Becaree <pierrelouis.chevallier60@gmail.com> |
Si c'est pour les élèves, les apprendre à coder en rajoutant plein de globaux, c'est vraiment pas top. Je m'explique: imaginons que j'ai une fonction clf() dans math de python et une fonction clf() dans pyplot. Les deux vont rentrer en conflit. De plus, a moins d'une très bonne connaissance des librairies, il peut arriver des conflits si je veux nommer une variable clf et l'utiliser. Il y a des cas spécifiques d'utilisation du import star même si c'est globalement (ahah) une mauvaise pratique. Certaine librairies utilise des __all__ dans les __init__.py permettant de limiter les globaux à l'import. Nota Bene, ce n'est pas le cas de fastai ;-)
Back to fr.comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
from matplotlib import pyplot as * ? Fabrice <professeur.leclercq@gmail.com> - 2019-07-13 01:03 +0200
Re: from matplotlib import pyplot as * ? Francois Lafont <francois.lafont@nospam.invalid> - 2019-07-13 01:51 +0200
Re: from matplotlib import pyplot as * ? Fabrice <professeur.leclercq@gmail.com> - 2019-07-13 14:42 +0200
Re: from matplotlib import pyplot as * ? Becaree <pierrelouis.chevallier60@gmail.com> - 2019-07-14 06:10 -0700
Re: from matplotlib import pyplot as * ? Fabrice <professeur.leclercq@gmail.com> - 2019-07-14 23:10 +0200
Re: from matplotlib import pyplot as * ? Becaree <pierrelouis.chevallier60@gmail.com> - 2019-07-15 11:40 -0700
Re: from matplotlib import pyplot as * ? Becaree <pierrelouis.chevallier60@gmail.com> - 2019-07-14 06:23 -0700
Re: from matplotlib import pyplot as * ? Becaree <pierrelouis.chevallier60@gmail.com> - 2019-07-15 11:44 -0700
csiph-web