Sujet : Re: A missing iterator on itertools module?
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 28. Mar 2024, 19:23:14
Autres entêtes
Organisation : Stefan Ram
Message-ID : <underscore-20240328182256@ram.dialup.fu-berlin.de>
References : 1 2 3
ast <
none@none.fr> wrote or quoted:
Why did you renamed itertools as _itertools ?
Assume I have a module A.py:
import math
def f(): pass
. Assume I have an additional module B.py:
import A
. Now, when I'm editing "B.py" in IDLE and type "A.", IIRC
IDLE will offer me two possible completions: "A.math" and
"A.f". The "A.math" makes no sense to me. I want it to go
away. Therefore, I rewrite A.py as:
import math as _math
def f(): pass
. Now, Idle will only offer the completion "A.f".
So, I sometimes use this "import math as _math" style. But then,
it is simpler for me to /always/ use this style; after all: you
can't know whether someone eventually will import your module!