Module lazily
Lazily import pygeodesy3
modules and attributes, based on
lazy_import from Brett Cannon's modutil.
Lazy import
is supported only for Python 3.7+ and enabled always in PyGeodesy3.
To enable lazy import
, set env
variable PYGEODESY3_LAZY_IMPORT
to1
,
2
, 3
prior to import pygeodesy3
.
Use 2
or higher to print a message for each lazily imported
module and attribute, similar to env
variable
PYTHONVERBOSE
showing imports. Using 3
or
higher also shows the importing file name and line number.
Notes:
-
Lazy import
applies only to top-level modules of
pygeodesy3
. A lazy import
of a top-level
module invariably loads all sub-modules imported by that top-level
module.
-
Lazy import
raises a LazyAttributeError or LazyImportError depending on the cause of the
error. Such errors can occur late, after all initial imports.
Version:
24.02.22
|
print_(*args,
**nl_nt_prefix_end_file_flush_sep)
Python 3+ print -like formatting and printing. |
|
|
|
printf(fmt,
*args,
**nl_nt_prefix_end_file_flush_sep_kwds)
Printf-style and Python 3+ print -like
formatting and printing. |
|
|
print_ (*args,
**nl_nt_prefix_end_file_flush_sep)
|
|
Python 3+ print -like formatting and printing.
- Arguments:
args - Arguments to be converted to str and joined by
sep (any type , all positional).
nl_nt_prefix_end_file_flush_sep - Keyword arguments nl=0 for the number of
leading blank lines (int ), nt=0
the number of trailing blank lines (int ),
prefix=NN to be inserted before the formatted
text (str ) and Python 3+ print keyword
arguments end , sep ,
file and flush .
- Returns:
- Number of bytes written.
|
printf (fmt,
*args,
**nl_nt_prefix_end_file_flush_sep_kwds)
|
|
Printf-style and Python 3+ print -like
formatting and printing.
- Arguments:
fmt - Printf-style format specification
(str ).
args - Arguments to be formatted (any type , all
positional).
nl_nt_prefix_end_file_flush_sep_kwds - Keyword arguments nl=0 for the number of
leading blank lines (int ), nt=0
the number of trailing blank lines (int ),
prefix=NN to be inserted before the formatted
text (str ) and Python 3+ print keyword
arguments end , sep ,
file and flush . Any
remaining kwds are printf-style keyword arguments to be formatted,
iff no args are present.
- Returns:
- Number of bytes written.
|