관리-도구
편집 파일: brain_hypothesis.cpython-311.pyc
� �܋f� � �x � d Z ddlmZ ddlmZ dZdefd�Zd� Z e� � � eee�� � d S ) aV Astroid hook for the Hypothesis library. Without this hook pylint reports no-value-for-parameter for use of strategies defined using the `@hypothesis.strategies.composite` decorator. For example: from hypothesis import strategies as st @st.composite def a_strategy(draw): return draw(st.integers()) a_strategy() � )�AstroidManager)�FunctionDef)� compositezst.compositezstrategies.compositezhypothesis.strategies.composite�returnc � � | j rT| j j rH| j j d j dk r-| j j D ] }|� � � t v r dS �!dS )z:Return whether a decorated node has @st.composite applied.r �drawTF)� decorators�args�name�nodes� as_string�COMPOSITE_NAMES)�node�decorator_attributes �o/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/astroid/brain/brain_hypothesis.py�is_decorated_with_st_compositer sk � ��� �4�9�>� �d�i�n�Q�.?�.D��.N�.N�#'�?�#8� � ��"�,�,�.�.�/�A�A��t�t� B��5� c �T � | j j d= | j j d= | j j d= | S )z�Given that the FunctionDef is decorated with @st.composite, remove the first argument (`draw`) - it's always supplied by Hypothesis so we don't need to emit the no-value-for-parameter lint. r )r �annotations�type_comment_args)r s r �-remove_draw_parameter_from_composite_strategyr '