
    Bed                     2    d Z ddlmZ 	 dgZ G d de	      Z
y)a?  
You cannot subclass bool, and this is necessary for round-tripping anchored
bool values (and also if you want to preserve the original way of writing)

bool.__bases__ is type 'int', so that is what is used as the basis for ScalarBoolean as well.

You can use these in an if statement, but not when testing equivalence
    )AnchorScalarBooleanc                   2    e Zd Zd Zed        ZddZddZy)r   c                     |j                  dd       }t        j                  | g|i |}||j                  |d       |S )NanchorT)always_dump)popint__new__yaml_set_anchor)clsargskwr   bs        6lib/python3.12/site-packages/ruamel/yaml/scalarbool.pyr   zScalarBoolean.__new__   sH    $'KK)d)b)f$7    c                     t        | t        j                        s#t        | t        j                  t                      t	        | t        j                        S N)hasattrr   attribsetattrgetattr)selfs    r   r   zScalarBoolean.anchor   s5     tV]]+D&--2tV]]++r   c                     t        | t        j                        sy |s| j                  j                  r| j                  S y r   )r   r   r   r   r   )r   anys     r   yaml_anchorzScalarBoolean.yaml_anchor$   s/    tV]]+$++));;r   c                 H    || j                   _        || j                   _        y r   )r   valuer   )r   r   r   s      r   r   zScalarBoolean.yaml_set_anchor,   s    !"-r   N)F)__name__
__module____qualname__r   propertyr   r   r    r   r   r   r      s%     , ,.r   N)__doc__ruamel.yaml.anchorr   typingTextAnyDictList__all__r
   r   r#   r   r   <module>r,      s(    & 
.C .r   