X7ROOT File Manager
Current Path:
/opt/alt/python312/lib/python3.12/site-packages/setuptools/_distutils
opt
/
alt
/
python312
/
lib
/
python3.12
/
site-packages
/
setuptools
/
_distutils
/
ðŸ“
..
📄
__init__.py
(359 B)
ðŸ“
__pycache__
📄
_collections.py
(5.18 KB)
📄
_functools.py
(1.73 KB)
📄
_log.py
(43 B)
📄
_macos_compat.py
(239 B)
📄
_modified.py
(2.35 KB)
📄
_msvccompiler.py
(19.16 KB)
📄
archive_util.py
(8.37 KB)
📄
bcppcompiler.py
(14.38 KB)
📄
ccompiler.py
(47.5 KB)
📄
cmd.py
(17.44 KB)
ðŸ“
command
📄
config.py
(4.8 KB)
📄
core.py
(9.18 KB)
📄
cygwinccompiler.py
(11.64 KB)
📄
debug.py
(139 B)
📄
dep_util.py
(349 B)
📄
dir_util.py
(7.88 KB)
📄
dist.py
(49 KB)
📄
errors.py
(3.5 KB)
📄
extension.py
(10.03 KB)
📄
fancy_getopt.py
(17.48 KB)
📄
file_util.py
(8.02 KB)
📄
filelist.py
(13.39 KB)
📄
log.py
(1.17 KB)
📄
msvc9compiler.py
(29.48 KB)
📄
msvccompiler.py
(23.02 KB)
📄
py38compat.py
(217 B)
📄
py39compat.py
(1.92 KB)
📄
spawn.py
(3.41 KB)
📄
sysconfig.py
(18.48 KB)
📄
text_file.py
(11.8 KB)
📄
unixccompiler.py
(15.24 KB)
📄
util.py
(17.68 KB)
📄
version.py
(12.65 KB)
📄
versionpredicate.py
(5.08 KB)
Editing: _functools.py
import collections.abc import functools # from jaraco.functools 3.5 def pass_none(func): """ Wrap func so it's not called if its first param is None >>> print_text = pass_none(print) >>> print_text('text') text >>> print_text(None) """ @functools.wraps(func) def wrapper(param, *args, **kwargs): if param is not None: return func(param, *args, **kwargs) return wrapper # from jaraco.functools 4.0 @functools.singledispatch def _splat_inner(args, func): """Splat args to func.""" return func(*args) @_splat_inner.register def _(args: collections.abc.Mapping, func): """Splat kargs to func as kwargs.""" return func(**args) def splat(func): """ Wrap func to expect its parameters to be passed positionally in a tuple. Has a similar effect to that of ``itertools.starmap`` over simple ``map``. >>> import itertools, operator >>> pairs = [(-1, 1), (0, 2)] >>> _ = tuple(itertools.starmap(print, pairs)) -1 1 0 2 >>> _ = tuple(map(splat(print), pairs)) -1 1 0 2 The approach generalizes to other iterators that don't have a "star" equivalent, such as a "starfilter". >>> list(filter(splat(operator.add), pairs)) [(0, 2)] Splat also accepts a mapping argument. >>> def is_nice(msg, code): ... return "smile" in msg or code == 0 >>> msgs = [ ... dict(msg='smile!', code=20), ... dict(msg='error :(', code=1), ... dict(msg='unknown', code=0), ... ] >>> for msg in filter(splat(is_nice), msgs): ... print(msg) {'msg': 'smile!', 'code': 20} {'msg': 'unknown', 'code': 0} """ return functools.wraps(func)(functools.partial(_splat_inner, func=func))
Upload File
Create Folder