@@ -97,21 +97,6 @@ def __str__(self):
9797            paths .append ('' )
9898            return  '' 
9999
100-     def  as_posix (self ):
101-         """Return the string representation of the path with forward (/) 
102-         slashes.""" 
103-         return  str (self ).replace (self .parser .sep , '/' )
104- 
105-     @property  
106-     def  drive (self ):
107-         """The drive prefix (letter or UNC path), if any.""" 
108-         return  self .parser .splitdrive (self .anchor )[0 ]
109- 
110-     @property  
111-     def  root (self ):
112-         """The root of the path, if any.""" 
113-         return  self .parser .splitdrive (self .anchor )[1 ]
114- 
115100    @property  
116101    def  anchor (self ):
117102        """The concatenation of the drive and root, or ''.""" 
@@ -183,51 +168,6 @@ def with_suffix(self, suffix):
183168        else :
184169            return  self .with_name (stem  +  suffix )
185170
186-     def  relative_to (self , other , * , walk_up = False ):
187-         """Return the relative path to another path identified by the passed 
188-         arguments.  If the operation is not possible (because this is not 
189-         related to the other path), raise ValueError. 
190- 
191-         The *walk_up* parameter controls whether `..` may be used to resolve 
192-         the path. 
193-         """ 
194-         if  not  isinstance (other , PurePathBase ):
195-             other  =  self .with_segments (other )
196-         anchor0 , parts0  =  self ._stack 
197-         anchor1 , parts1  =  other ._stack 
198-         if  anchor0  !=  anchor1 :
199-             raise  ValueError (f"{ str (self )!r} { str (other )!r}  )
200-         while  parts0  and  parts1  and  parts0 [- 1 ] ==  parts1 [- 1 ]:
201-             parts0 .pop ()
202-             parts1 .pop ()
203-         for  part  in  parts1 :
204-             if  not  part  or  part  ==  '.' :
205-                 pass 
206-             elif  not  walk_up :
207-                 raise  ValueError (f"{ str (self )!r} { str (other )!r}  )
208-             elif  part  ==  '..' :
209-                 raise  ValueError (f"'..' segment in { str (other )!r}  )
210-             else :
211-                 parts0 .append ('..' )
212-         return  self .with_segments (* reversed (parts0 ))
213- 
214-     def  is_relative_to (self , other ):
215-         """Return True if the path is relative to another path or False. 
216-         """ 
217-         if  not  isinstance (other , PurePathBase ):
218-             other  =  self .with_segments (other )
219-         anchor0 , parts0  =  self ._stack 
220-         anchor1 , parts1  =  other ._stack 
221-         if  anchor0  !=  anchor1 :
222-             return  False 
223-         while  parts0  and  parts1  and  parts0 [- 1 ] ==  parts1 [- 1 ]:
224-             parts0 .pop ()
225-             parts1 .pop ()
226-         for  part  in  parts1 :
227-             if  part  and  part  !=  '.' :
228-                 return  False 
229-         return  True 
230- 
231171    @property  
232172    def  parts (self ):
233173        """An object providing sequence-like access to the 
@@ -296,11 +236,6 @@ def parents(self):
296236            parent  =  split (path )[0 ]
297237        return  tuple (parents )
298238
299-     def  is_absolute (self ):
300-         """True if the path is absolute (has both a root and, if applicable, 
301-         a drive).""" 
302-         return  self .parser .isabs (str (self ))
303- 
304239    @property  
305240    def  _pattern_str (self ):
306241        """The path expressed as a string, for use in pattern-matching.""" 
0 commit comments