There are several cases in the Python standard library where modules are imported with a leading underscore (_
) in their name. I wonder why this is necessary, as it is under the module's name anyways and from ... import *
will respect the __all__
variable for what to import.
Does anyone know why this is used/necessary?
An example is argparse
which has the following imports:
import collections as _collections
import copy as _copy
import os as _os
import re as _re
import sys as _sys
import textwrap as _textwrap