관리-도구
편집 파일: _functools.cpython-311.pyc
� N�Dg� � �| � d dl Zd dlZd� Zej d� � � Zej dej j fd�� � Z d� Z dS )� Nc �F � � t j � � � � fd�� � }|S )z� 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) c �$ �� | � �| g|�R i |��S d S )N� )�param�args�kwargs�funcs ���/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/_distutils/_functools.py�wrapperzpass_none.<locals>.wrapper s1 �� ����4��/��/�/�/��/�/�/� �� )� functools�wraps)r r s ` r � pass_noner s: �� � �_�T���0� 0� 0� 0� ��0� �Nr c � � || � S )zSplat args to func.r �r r s r �_splat_innerr s � � �4��;�r r c � � |di | ��S )zSplat kargs to func as kwargs.r r r s r �_r s � � �4�<�<�$�<�<�r c �n � t j | � � t j t | �� � � � S )a� 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} �r )r r �partialr r s r �splatr % s/ � �H !�9�?�4� � ��!2�<�d�!K�!K�!K�L�L�Lr )�collections.abc�collectionsr r �singledispatchr �register�abc�Mappingr r r r r �<module>r s� �� � � � � � � � �� � �&