+
    O(iVJ              	          R t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH t  ^ RIH!t! ]! RRR7      t"]! RRR7      t#]! R4      t$]! RR R!7       ! R" R4      4       t% ! R# R$]%]]]]3,          4      t& ! R% R&]&]]'](3,          4      t) ! R' R(]&] ]]!3,          4      t*R# ))zPathable paths moduleN)Hashable)Iterator)contextmanager)	dataclass)cached_property)Path)Any)Generic)Sequence)TypeVar)cast)overload)KLookupAccessor)N)NodeAccessorPathAccessorV)	SEPARATOR)parse_parts)	LookupKey)
LookupNode)LookupValue	TBasePathBasePath)boundTAccessorPathzAccessorPath[Any, Any, Any]TDefaultTF)frozeninitc                     a  ] tR t^#t o Rt]tRR/V 3R lR llt]]3V 3R lR ll4       t	]RHV 3R lR	 ll4       t
]RHV 3R
 lR ll4       t]V 3R lR l4       t]V 3R lR l4       tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR lt]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R  lR! l4       t]V 3R" lR# l4       t]V 3R$ lR% l4       t]V 3R& lR' l4       tV 3R( lR) ltV 3R* lR+ ltV 3R, lR- ltV 3R. lR/ ltV 3R0 lR1 lt V 3R2 lR3 lt!V 3R4 lR5 lt"V 3R6 lR7 lt#V 3R8 lR9 lt$V 3R: lR; lt%V 3R< lR= lt&V 3R> lR? lt'V 3R@ lRA lt(V 3RB lRC lt)V 3RD lRE lt*V 3RF lt+RGt,V t-R# )Ir   z
Base path.	separatorNc                4   < V ^8  d   QhRS[ RS[R,          /# )   argsr$   N)r   str)format__classdict__s   "T/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/pathable/paths.py__annotate__BasePath.__annotate__*   s     1 1c 1cDj 1    c                   \         P                  T R T;'       g    V P                  4       V P                  W P                  R7      p\         P                  V RV4       R# )r$   seppartsN)object__setattr__r$   _parse_args)selfr$   r'   r2   s   &$* r+   __init__BasePath.__init__*   sI    4i.I.I4>>J  >> :4%0r.   c                P   < V ^8  d   QhRS[ S[,          RS[RS[S[R3,          /# )r&   r'   r1   return.)r
   r   r(   tupler   )r)   r*   s   "r+   r,   r-   0   s6     ,. ,.sm,. ,. 
x}		,.r.   c                   . pVP                   pVP                  pV EF  pTp\        Wp4      '       d   V! VP                  4       K+  \        V\        4      '       d   V! VP                  R4      4       KZ  \        V\        P                  4      '       dF   \        P                  ! V4      p\        V\        4      '       d   V! VP                  R4      4       K  \        V\        \        34      '       d   V! V4       K  \        V\        4      '       d   V! V4       EK  \        R\        V4      : 24      h	  \        \        W24      4      # )zParse constructor arguments into canonical parts.

Subclasses may override this class method to customize parsing rules
(e.g. accepted part types) while preserving the public constructor
behavior.
asciiz@argument must be Hashable, bytes, os.PathLike, or BasePath; got )appendextend
isinstancer2   bytesdecodeosPathLikefspathr(   intr   	TypeErrortyper;   r   )clsr'   r1   r2   r>   r?   argparts   &&&     r+   r5   BasePath._parse_args/   s    !#CD$$$tzz"$&&t{{7+,$,,yydE**4;;w/0$c
++t$))t:  3 : [,--r.   c                `   < V ^8  d   QhRS[ S[,          RS[S[,          RS[R,          RS[/# )r&   rI   r'   r$   Nr:   )rH   r   r
   r   r(   )r)   r*   s   "r+   r,   r-   _   s=     / /)_/sm/ :/ 
	/r.   c                    V ! VR V/ # r$    )rI   r'   r$   s   &&&r+   _from_partsBasePath._from_parts^   s     D.I..r.   c                b   < V ^8  d   QhRS[ S[,          RS[S[R3,          RS[R,          RR/# )r&   rI   r2   .r$   Nr:   r   )rH   r   r;   r   r(   )r)   r*   s   "r+   r,   r-   g   sB     
 
)_
Xs]#
 :
 
	
r.   c                    V P                  V 4      p\        P                  VR V4       \        P                  TRT;'       g    VP                  4       V# )r2   r$   )__new__r3   r4   r$   )rI   r2   r$   instances   &&& r+   _from_parsed_partsBasePath._from_parsed_partsf   sN     ;;s#8We4k9#B#B0B0B	
 r.   c                4   < V ^8  d   QhRS[ S[R3,          /# r&   r:   .r;   r(   )r)   r*   s   "r+   r,   r-   t   s     1 1sCx 1r.   c                    \         ;QJ d    . R  V P                   4       F  NK  	  5# ! R  V P                   4       4      # )c              3   8   "   T F  p\        V4      x  K  	  R # 5iNr(   .0ps   & r+   	<genexpr>#BasePath._cparts.<locals>.<genexpr>v   s     0ZSVVZ   )r;   r2   r6   s   &r+   _cpartsBasePath._cpartss   s.     u0TZZ0u0u0TZZ000r.   c                J   < V ^8  d   QhRS[ S[ S[S[3,          R3,          /# rZ   r[   )r)   r*   s   "r+   r,   r-   y   s&     

 

E%S/3"67 

r.   c           	         \         ;QJ d4    . R \        V P                  V P                  RR7       4       F  NK  	  5# ! R \        V P                  V P                  RR7       4       4      # )zStable, type-aware comparison key for ordering.

We include a fully-qualified type identifier so that e.g. `0` and "0"
compare deterministically without being considered equal, and so that
similarly-named types from different modules do not collide.
c              3      "   T F6  w  r\        V4      P                   R \        V4      P                   2V3x  K8  	  R# 5i).N)rH   
__module____qualname__)ra   rb   cs   &  r+   rc   &BasePath._cmp_parts.<locals>.<genexpr>   s?      
B Q""#1T!W%9%9$:;Q?Bs   >A T)strict)r;   zipr2   rg   rf   s   &r+   
_cmp_partsBasePath._cmp_partsx   sX     u 
DJJTB
u 	
u 
DJJTB
 
 	
r.   c                <   < V ^8  d   QhRS[ RS[S[,          RS[ /# )r&   r6   r'   r:   )r   listr   )r)   r*   s   "r+   r,   r-      s&     4 4) 449 4 4r.   c                    V P                  WP                  R 7      pV P                  V,           pV P                  V4      # )r0   )r5   r$   r2   _clone_with_parts)r6   r'   r2   parts_joineds   &&  r+   _make_childBasePath._make_child   s8      >> :zzE)%%l33r.   c                ,   < V ^8  d   QhRS[ RS[RS[ /# )r&   r6   rK   r:   r   r   )r)   r*   s   "r+   r,   r-      s"     - -) -8 -	 -r.   c                L    V P                   V3,           pV P                  V4      # r^   r2   rx   )r6   rK   r2   s   && r+   _make_child_relpathBasePath._make_child_relpath   s%     

dW$%%e,,r.   c                @   < V ^8  d   QhRS[ RS[S[R3,          RS[ /# r&   r6   r2   .r:   )r   r;   r   )r)   r*   s   "r+   r,   r-      s3     H HH %hm 4H	Hr.   c                :    V P                  WP                  R7      # )zCreate a new instance of the same class with the given parts.

Subclasses like `AccessorPath` require extra constructor state (e.g. accessor).
This helper attempts to preserve that state.
rO   )rW   r$   r6   r2   s   &&r+   rx   BasePath._clone_with_parts   s     &&u&GGr.   c                    < V ^8  d   QhRS[ /# r&   r:   r_   )r)   r*   s   "r+   r,   r-      s      C r.   c                    \        V 4      # r^   r_   rf   s   &r+   
__fspath__BasePath.__fspath__   s    4yr.   c                    < V ^8  d   QhRS[ /# r   r_   )r)   r*   s   "r+   r,   r-      s     4 4# 4r.   c                F    RP                  R V P                   4       4      # )z2Return the path as a POSIX path (always uses '/')./c              3   8   "   T F  p\        V4      x  K  	  R # 5ir^   r_   r`   s   & r+   rc   $BasePath.as_posix.<locals>.<genexpr>   s     3
1A
re   )joinr2   rf   s   &r+   as_posixBasePath.as_posix   s    xx3

333r.   c                    < V ^8  d   QhRS[ /# r   r_   )r)   r*   s   "r+   r,   r-      s     # #c #r.   c                b    V P                   '       g   R# \        V P                   R,          4      # )zFinal path component. )r2   r(   rf   s   &r+   nameBasePath.name   s#     zzz4::b>""r.   c                <   < V ^8  d   QhRS[ RS[S[ S[ 3,          /# )r&   r   r:   )r(   r;   )r)   r*   s   "r+   r,   r-      s#     
& 
& 
&sCx 
&r.   c                    V R9   d   V R 3# V P                  R4      pV^ 8:  d   V^ 8X  d   RV R,          9  d   V R 3# V R 3# V RV WR 3# )r   rl      NNNr   rl   z..)rfind)r   dots   & r+   _split_stem_suffixBasePath._split_stem_suffix   sb     ?"8Ojjo!8axCtBx/Rx8ODSz4:%%r.   c                    < V ^8  d   QhRS[ /# r   r_   )r)   r*   s   "r+   r,   r-      s       r.   c                @    V P                  V P                  4      w  rV# )z9Final component's last suffix, including the leading dot.r   r   )r6   stemsuffixs   &  r+   r   BasePath.suffix   s     ..tyy9r.   c                0   < V ^8  d   QhRS[ S[,          /# r   )rv   r(   )r)   r*   s   "r+   r,   r-      s     , ,$s) ,r.   c                   V P                   pVR9   d   . # VP                  R4      '       d   VR,          pRV9  d   . # TpVP                  R4      p\        V4      ^8:  d   . # VR,           Uu. uF  pRV,           NK  	  up# u upi )z;Final component's suffixes, each including the leading dot.rl   r   r   )r   
startswithsplitlen)r6   r   restr2   rb   s   &    r+   suffixesBasePath.suffixes   s     yy?"I??38D$	D

3u:?I!&r+Aa+++s   /Bc                    < V ^8  d   QhRS[ /# r   r_   )r)   r*   s   "r+   r,   r-      s      c r.   c                @    V P                  V P                  4      w  rV# )z(Final component without its last suffix.r   )r6   r   _s   &  r+   r   BasePath.stem   s     ))$))4r.   c                &   < V ^8  d   QhRS[ RS[ /# r&   r6   r:   )r   )r)   r*   s   "r+   r,   r-      s     7 7Y 79 7r.   c                f    V P                   '       g   V # V P                  V P                   RR 4      # )zLogical parent path.Nr   r   rf   s   &r+   parentBasePath.parent   s-     zzzK%%djj"o66r.   c                :   < V ^8  d   QhRS[ RS[S[ R3,          /# )r&   r6   r:   .)r   r;   )r)   r*   s   "r+   r,   r-      s$     
 
i 
E)S.$9 
r.   c           	        a  S P                   '       g   R# \        ;QJ d;    . V 3R l\        ^\        S P                   4      ^,           4       4       F  NK  	  5# ! V 3R l\        ^\        S P                   4      ^,           4       4       4      # )z.Logical ancestors (like pathlib's `.parents`).c              3   b   <"   T F$  pSP                  SP                  R V)  4      x  K&  	  R # 5ir^   )rx   r2   )ra   ir6   s   & r+   rc   #BasePath.parents.<locals>.<genexpr>   s2      
2 ""4::cr?332s   ,/rP   )r2   r;   ranger   rf   s   fr+   parentsBasePath.parents   sm     zzzIu 
1c$**o12
u 	
u 
1c$**o12
 
 	
r.   c                ,   < V ^8  d   QhRS[ RS[RS[ /# r&   r6   otherr:   r   r   )r)   r*   s   "r+   r,   r-      s"     - -y -# -) -r.   c                6    V P                  \        V4      4      # )z,Combine this path with one or more segments.)rz   rv   r6   r   s   &*r+   joinpathBasePath.joinpath   s    U,,r.   c                ,   < V ^8  d   QhRS[ RS[RS[ /# )r&   r6   r   r:   r   r(   )r)   r*   s   "r+   r,   r-      s"     1 1	 1 1 1r.   c                ,   V P                   '       g   \        R4      h\        V\        4      '       g   \	        R4      hV'       g   \        R4      hV P
                  V9   d   \        R4      hV P                   RR V3,           pV P                  V4      # )z4Return a new path with the final component replaced.z%with_name() requires a non-empty pathzname must be a strzname must be non-emptyz$name must not contain path separatorNr   )r2   
ValueErrorr@   r(   rG   r$   rx   )r6   r   	new_partss   && r+   	with_nameBasePath.with_name   s~    zzzDEE$$$011566>>T!CDDJJsOtg-	%%i00r.   c                ,   < V ^8  d   QhRS[ RS[RS[ /# )r&   r6   r   r:   r   )r)   r*   s   "r+   r,   r-      s"     ( () (S (Y (r.   c                V   V P                   '       g   \        R4      h\        V\        4      '       g   \	        R4      hV'       d#   VP                  R4      '       g   \        R4      hV P                  pVR9   d   \        R4      hV P                  V,           pV P                  V4      # )z<Return a new path with the final component's suffix changed.z'with_suffix() requires a non-empty pathzsuffix must be a strrl   z#Invalid suffix; must start with '.'zInvalid name for with_suffix()r   )	r2   r   r@   r(   rG   r   r   r   r   )r6   r   r   new_names   &&  r+   with_suffixBasePath.with_suffix   s    zzzFGG&#&&233&++C00BCCyy?"=>>99v%~~h''r.   c                &   < V ^8  d   QhRS[ RS[/# r&   r   r:   r   bool)r)   r*   s   "r+   r,   r-     s     = =S =T =r.   c                    V P                  WP                  R7      p\        V4      \        V P                  4      8  d   R# V P                  R\        V4       V8H  # )z/Return True if the path is relative to `other`.r0   FN)r5   r$   r   r2   r6   r   other_partss   &* r+   is_relative_toBasePath.is_relative_to  sM    &&u..&A{c$**o-zz,C,-<<r.   c                ,   < V ^8  d   QhRS[ RS[RS[ /# r   r   )r)   r*   s   "r+   r,   r-     s'     
F 
F) 
FS 
FY 
Fr.   c           	        V P                  WP                  R7      pV P                  ! V!  '       g1   \        V : R\        P                  W P                  R7      : 24      hV P                  V P                  \        V4      R 4      # )z^Return the relative path from `other` to self.

Raises ValueError if self is not under other.
r0   z is not in the subpath of rO   N)	r5   r$   r   r   r   rW   rx   r2   r   r   s   &* r+   relative_toBasePath.relative_to  s    
 &&u..&A""K00(4X5P5PQ\hvhv5P5w4z{  %%djj[1A1C&DEEr.   c                    < V ^8  d   QhRS[ /# r   r_   )r)   r*   s   "r+   r,   r-     s     1 1 1r.   c                L    V P                   P                  V P                  4      # r^   )r$   r   rg   rf   s   &r+   __str__BasePath.__str__  s    ~~""4<<00r.   c                    < V ^8  d   QhRS[ /# r   r_   )r)   r*   s   "r+   r,   r-     s     ; ;# ;r.   c                N    V P                   P                   R \        V 4      : R2# )())	__class____name__r(   rf   s   &r+   __repr__BasePath.__repr__  s$    ..))*!CI=::r.   c                    < V ^8  d   QhRS[ /# r   rF   )r)   r*   s   "r+   r,   r-     s     2 2# 2r.   c                D    \        V P                  V P                  34      # r^   )hashr$   r2   rf   s   &r+   __hash__BasePath.__hash__  s    T^^TZZ011r.   c                ,   < V ^8  d   QhRS[ RS[RS[ /# r&   r6   keyr:   r   )r)   r*   s   "r+   r,   r-     s"     " ") "# ") "r.   c                V     V P                  V.4      #   \         d
    \        u # i ; ir^   )rz   rG   NotImplementedr6   r   s   &&r+   __truediv__BasePath.__truediv__  s9    	"## 
  	"!!	"s    ((c                ,   < V ^8  d   QhRS[ RS[RS[ /# r   r}   )r)   r*   s   "r+   r,   r-   '  s"     " "9 "8 "	 "r.   c                     V P                  V3V P                  ,           V P                  R 7      #   \         d
    \        u # i ; i)rO   )rQ   r2   r$   rG   r   r   s   &&r+   __rtruediv__BasePath.__rtruediv__'  sJ    	"###t~~ $    	"!!	"s   .1 AAc                &   < V ^8  d   QhRS[ RS[/# r   r   )r)   r*   s   "r+   r,   r-   /  s     N NC ND Nr.   c                    \        V\        4      '       g   \        # V P                  V P                  3VP                  VP                  38H  # r^   )r@   r   r   r$   r2   r   s   &&r+   __eq__BasePath.__eq__/  s:    %**!!

+/MMMr.   c                &   < V ^8  d   QhRS[ RS[/# r   r   )r)   r*   s   "r+   r,   r-   4       
 
C 
D 
r.   c                    \        V\        4      '       g   \        # V P                  V P                  3VP                  VP                  38  # r^   r@   r   r   r$   rs   r   s   &&r+   __lt__BasePath.__lt__4  D    %**!!0OO4
 
 	
r.   c                &   < V ^8  d   QhRS[ RS[/# r   r   )r)   r*   s   "r+   r,   r-   <  r  r.   c                    \        V\        4      '       g   \        # V P                  V P                  3VP                  VP                  38*  # r^   r  r   s   &&r+   __le__BasePath.__le__<  D    %**!!0OO5
 
 	
r.   c                &   < V ^8  d   QhRS[ RS[/# r   r   )r)   r*   s   "r+   r,   r-   D  r  r.   c                    \        V\        4      '       g   \        # V P                  V P                  3VP                  VP                  38  # r^   r  r   s   &&r+   __gt__BasePath.__gt__D  r  r.   c                &   < V ^8  d   QhRS[ RS[/# r   r   )r)   r*   s   "r+   r,   r-   L  r  r.   c                    \        V\        4      '       g   \        # V P                  V P                  3VP                  VP                  38  # r^   r  r   s   &&r+   __ge__BasePath.__ge__L  r  r.   c                F   < V ^8  d   Qh/ S[ S[R3,          ;R&   S[;R&   # )r&   .r2   r$   )r;   r   r(   )r)   r*   s   "r+   r,   r-   #   s(      3	 
  r.   rP   r^   ).r   rm   rn   __firstlineno____doc__r   r$   r7   classmethodr5   rQ   rW   r   rg   rs   rz   r   rx   r   r   r   staticmethodr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r	  r  r  r  __annotate_func____static_attributes____classdictcell__r*   s   @r+   r   r   #   s     I14 1 1
  ,. ,. ,.\ / / / 
 
 
 1 1 

 

4 4
- -H H 4 4 # # 
& 
&  
 , ,  
 7 7 
 
- -1 1( (= =
F 
F1 1; ;2 2" "" "N N

 

 

 

 
S	  r.   c                     a a ] tR tRt oRtRR/V3R lV 3R lllt]R1V3R lR ll4       t]R1V3R	 lR
 ll4       tV3R lR lt	V3R lR lt
V3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR  ltV3R! lR" lt]V3R# lR$ l4       t]V3R% lR& l4       tR2V3R' lR( lltV3R) lR* ltV3R+ lR, lt]V3R- lR. l4       tV3R/ ltR0tVtV ;t# )3AccessorPathiU  z-Path for object that can be read by accessor.r$   Nc                T   < V ^8  d   QhRS[ S[S[S[3,          RS[RS[R,          /# )r&   accessorr'   r$   N)r   r   r   r   r   r(   )r)   r*   s   "r+   r,   AccessorPath.__annotate__[  s8     5 5q!Qw'5 5 :	5r.   c               V   < \         P                  V R V4       \        SV `  ! VRV/  R# )r%  r$   N)r3   r4   superr7   )r6   r%  r$   r'   r   s   &&$*r+   r7   AccessorPath.__init__[  s)     	4X6$4)4r.   c                   < V ^8  d   QhRS[ S[,          RS[S[,          RS[R,          RS[S[S[S[3,          R,          RS[/# )r&   rI   r'   r$   Nr%  r:   )	rH   r   r
   r   r(   r   r   r   r   )r)   r*   s   "r+   r,   r&  e  sX     9 9- 9sm9 :9 q!Qw'$.	9
 
9r.   c                8    Vf   \        R4      hV ! V.VO5RV/ # )Naccessor must be providedr$   )r   )rI   r'   r$   r%  s   &&&&r+   rQ   AccessorPath._from_partsd  s+     89988d8i88r.   c                   < V ^8  d   QhRS[ S[,          RS[S[R3,          RS[R,          RS[S[S[S[3,          R,          RS[/# )r&   rI   r2   .r$   Nr%  r:   )	rH   r   r;   r   r(   r   r   r   r   )r)   r*   s   "r+   r,   r&  p  s]      - Xs]# : q!Qw'$.	
 
r.   c                    Vf   \        R4      hV P                  V 4      p\        P                  VRV4       \        P                  TRT;'       g    VP                  4       \        P                  VRV4       V# )Nr,  r2   r$   r%  )r   rU   r3   r4   r$   )rI   r2   r$   r%  rV   s   &&&& r+   rW   AccessorPath._from_parsed_partso  sr     899;;s#8We4k9#B#B0B0B	
 	8Z:r.   c                @   < V ^8  d   QhRS[ RS[S[R3,          RS[ /# r   )r   r;   r   )r)   r*   s   "r+   r,   r&    s.     
 

$)(C-$8
	
r.   c                R    V P                  VV P                  V P                  R7      # )z=Create a new instance of the same class with the given parts.r$   r%  )rW   r$   r%  r   s   &&r+   rx   AccessorPath._clone_with_parts  s-     &&nn]] ' 
 	
r.   c                ,   < V ^8  d   QhRS[ RS[RS[ /# r   )r   r   )r)   r*   s   "r+   r,   r&    s"     " "= "x "M "r.   c                     V P                  V3V P                  ,           V P                  V P                  R 7      #   \         d
    \
        u # i ; i)r3  )rQ   r2   r$   r%  rG   r   r   s   &&r+   r   AccessorPath.__rtruediv__  sR    	"###.. $  
  	"!!	"s   9< AAc                ,   < V ^8  d   QhRS[ RS[RS[ /# r   r   r   )r)   r*   s   "r+   r,   r&    s"     - -= -q -] -r.   c                p    V P                   P                  V P                  V4       V P                  V4      # )z1Return a new existing path with the key appended.)r%  require_childr2   r   r   s   &&r+   __floordiv__AccessorPath.__floordiv__  s+    ##DJJ4'',,r.   c                ,   < V ^8  d   QhRS[ RS[RS[ /# r   r9  )r)   r*   s   "r+   r,   r&    s"      M  m r.   c                `    W,          pVP                   P                  VP                  4       V# )z2Return a new existing path with the key prepended.)r%  validater2   )r6   r   news   && r+   __rfloordiv__AccessorPath.__rfloordiv__  s&    j 	cii(
r.   c                6   < V ^8  d   QhRS[ RS[S[ ,          /# r   )r   r   )r)   r*   s   "r+   r,   r&    s      0 0} 0-)@ 0r.   c              #     "   V P                   P                  V P                  4       F  pV P                  V4      x  K  	  R# 5i)zZIterate over all child paths.

Raises KeyError if the path is missing or non-traversable.
Nr%  keysr2   r   r   s   & r+   __iter__AccessorPath.__iter__  s5     
 ==%%djj1C**3// 2s   AAc                <   < V ^8  d   QhRS[ RS[RS[S[ ,          /# r   )r   r   r   )r)   r*   s   "r+   r,   r&    s'     . .- .a .A4E .r.   c                   Rp V P                   V P                  ,          pV P                   P                  W14      p T P                   P                  T4      '       d   T P                  T4      pT#   \        \        T P                   P                  T4      4      #   \         dD    Y,          pTP	                  4       '       d   Tu # \        \        TP                  4       4      u # i ; i  \         d*    Tf	   Y,          pTP	                  4       '       d   Tu #  Li ; i  \         d.    Tf	   Y,          p\        \        TP                  4       4      u # i ; i)zAccess a child path's value.N)r%  r2   _get_subnodeNotImplementedErroris_traversabler   r   
read_value_is_traversable_noder   
_read_node)r6   r   pathr   childs   &&   r+   __getitem__AccessorPath.__getitem__  s,   %)	.]]4::.FMM..v;E	}}11%88//4 9	.4==33E:;;% # 	.;D""$$4??,--	. # 	|{""$$ %	 # 	.|{4??,--	.sF   8B  C- C- 3(D$ +C*	C*)C*-,D!D! D!$5EEc                &   < V ^8  d   QhRS[ RS[/# )r&   r   r:   )r   r   )r)   r*   s   "r+   r,   r&    s     7 7 7d 7r.   c                N    V P                   P                  V P                  V4      # )zCheck if a key exists in the path.

This mirrors typical container semantics: membership checks return a
boolean and do not raise for missing/non-traversable intermediate
nodes.
)r%  containsr2   r   s   &&r+   __contains__AccessorPath.__contains__  s     }}%%djj#66r.   c                    < V ^8  d   QhRS[ /# r   r   )r)   r*   s   "r+   r,   r&    s     - - -r.   c                L    V P                   P                  V P                  4      # )z^Return the number of child paths.

Raises KeyError if the path is missing or non-traversable.
)r%  r   r2   rf   s   &r+   __len__AccessorPath.__len__  s    
 }}  ,,r.   c                    < V ^8  d   QhRS[ /# r   r   )r)   r*   s   "r+   r,   r&    s     : : :r.   c                P    V P                   P                  V P                  4      RJ# )zCheck if the path exists.Nr%  statr2   rf   s   &r+   existsAccessorPath.exists  s     }}!!$**-T99r.   c                    < V ^8  d   QhRS[ /# r   r`  )r)   r*   s   "r+   r,   r&    s     8 8 8r.   c                L    V P                   P                  V P                  4      # )zxReturn True if the path can enumerate child keys.

This is a convenience wrapper around `accessor.is_traversable(...)`.
)r%  rN  r2   rf   s   &r+   rN  AccessorPath.is_traversable  s    
 }}++DJJ77r.   c                0   < V ^8  d   QhRS[ S[,          /# r   )r
   r   )r)   r*   s   "r+   r,   r&    s     . .hqk .r.   c                L    V P                   P                  V P                  4      # )zaReturn all keys at the current path.

Raises KeyError if the path is missing or non-traversable.
)r%  rG  r2   rf   s   &r+   rG  AccessorPath.keys  s    
 }}!!$**--r.   c                L   < V ^8  d   QhRS[ RS[S[S[S[ 3,          ,          /# r   )r   r   r;   r   )r)   r*   s   "r+   r,   r&    s*     5 5M 5huQ5E/F&G 5r.   c              #     "   V P                   P                  V P                  4       F  pWP                  V4      3x  K  	  R# 5i)zReturn path's items.NrF  r   s   & r+   itemsAccessorPath.items  s6     ==%%djj1C//444 2s   AAc                4   < V ^8  d   QhRS[ RS[R,          /# )r&   r   r:   N)r   r   )r)   r*   s   "r+   r,   r&    s    **q*QX*r.   c                    R # r^   rP   r   s   &&r+   getAccessorPath.get  s    '*r.   c                <   < V ^8  d   QhRS[ RS[RS[S[,          /# r&   r   defaultr:   )r   r    r   )r)   r*   s   "r+   r,   r&    s    AAqA8AHAr.   c                    R # r^   rP   r6   r   rv  s   &&&r+   rr  rs    s    >Ar.   c                ,   < V ^8  d   QhRS[ RS[RS[/# ru  )r   r3   )r)   r*   s   "r+   r,   r&    s"      q 6 V r.   c                :     W,          #   \          d    Tu # i ; i)z=Return the value for key if key is in the path, else default.)KeyErrorrx  s   &&&r+   rr  rs    s#    	9 	N	s   
 c                    < V ^8  d   QhRS[ /# r   r   )r)   r*   s   "r+   r,   r&    s     . .A .r.   c                L    V P                   P                  V P                  4      # )zReturn the path's value.)r%  readr2   rf   s   &r+   rO  AccessorPath.read_value      }}!!$**--r.   c                D   < V ^8  d   QhRS[ S[S[3,          R,          /# )r&   r:   N)dictr(   r   )r)   r*   s   "r+   r,   r&    s!     . .d38nt+ .r.   c                L    V P                   P                  V P                  4      # )z:Return metadata for the path, or None if it doesn't exist.rb  rf   s   &r+   rc  AccessorPath.stat  r  r.   c                0   < V ^8  d   QhRS[ S[,          /# r   )r   r   )r)   r*   s   "r+   r,   r&    s        hqk  r.   c              #  2   "   V P                  4       x  R# 5i)zwContext manager that yields the current path's value.

This mirrors a file-like "open" API but works for any accessor.
N)rO  rf   s   &r+   openAccessorPath.open  s      oos   c                `   < V ^8  d   Qh/ S[ S[R3,          ;R&   S[S[S[S[3,          ;R&   # )r&   .r2   r%  )r;   r   r   r   r   )r)   r*   s   "r+   r,   r&  U  s2      C=  1a7##	 r.   rP   )NNr^   )r   rm   rn   r  r  r7   r  rQ   rW   rx   r   r<  rB  rH  rT  rY  r]  rd  rN  rG  rn  r   rr  rO  rc  r   r  r  r  r   __classcell__)r   r*   s   @@r+   r#  r#  U  s    7
5 !%	5 5 9 9 9    
 
" "- -
 0 0. .B7 7- -: :8 8. .5 5
 * *A A . .. .    o  r.   r#  c                   @   a  ] tR tRt o Rt]V 3R lR l4       tRtV tR# )FilesystemPathi  zPath for filesystem objects.c                8   < V ^8  d   QhRS[ R,          RS[RR/# )r&   rI   r  rR  r:   )rH   r   )r)   r*   s   "r+   r,   FilesystemPath.__annotate__  s-      "# 
r.   c                (    \        V4      pV ! V4      # )z*Public constructor for a Path-backed path.r   )rI   rR  r%  s   && r+   	from_pathFilesystemPath.from_path  s      %8}r.   rP   N)	r   rm   rn   r  r  r  r  r  r   r!  s   @r+   r  r    s     & r.   r  c                   \   a  ] tR tRt o Rt]V 3R lR l4       t]V 3R lR l4       tRtV t	R# )	
LookupPathi!  z2Path for object that supports __getitem__ lookups.c          
      D   < V ^8  d   QhRS[ R,          RS[RS[RS[RR/# r&   rI   r  lookupr'   kwargsr:   rH   r   r   )r)   r*   s   "r+   r,   LookupPath.__annotate__%  s@     9 9,99 9 	9
 
9r.   c                .    V P                   ! V.VO5/ VB # )z,Public constructor for a lookup-backed path.)_from_lookup)rI   r  r'   r  s   &&*,r+   from_lookupLookupPath.from_lookup$  s     8888r.   c          
      D   < V ^8  d   QhRS[ R,          RS[RS[RS[RR/# r  r  )r)   r*   s   "r+   r,   r  /  s@     . .,.. . 	.
 
.r.   c                0    \        V4      pV ! V.VO5/ VB # r^   r   )rI   r  r'   r  r%  s   &&*, r+   r  LookupPath._from_lookup.  s#     "&)8-d-f--r.   rP   N)
r   rm   rn   r  r  r  r  r  r  r   r!  s   @r+   r  r  !  s.     <9 9 . .r.   r  )+r  rC   collections.abcr   r   
contextlibr   dataclassesr   	functoolsr   pathlibr   typingr   r	   r
   r   r   r   pathable.accessorsr   r   r   r   r   r   pathable.parsersr   r   pathable.typesr   r   r   r   r   r    r   r#  r(   rA   r  r  rP   r.   r+   <module>r     s     	 $ $ % ! %          -   + +   & ( $ % & Kz2	/LM: $U#n
 n
 $n
b	| 8WQ1W- | ~
\$U"23 
.j)[@A .r.   