@@ -46,25 +46,6 @@ def _is_wildcard_pattern(pat):
4646 return "*" in pat or "?" in pat or "[" in pat
4747
4848
49- class _Flavour (object ):
50- """A flavour implements a particular (platform-specific) set of path
51- semantics."""
52-
53-
54- class _WindowsFlavour (_Flavour ):
55- # Reference for Windows paths can be found at
56- # http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx
57- pass
58-
59-
60- class _PosixFlavour (_Flavour ):
61- pass
62-
63-
64- _windows_flavour = _WindowsFlavour ()
65- _posix_flavour = _PosixFlavour ()
66-
67-
6849class _Accessor :
6950 """An accessor implements a particular (system-specific or not) way of
7051 accessing paths on the filesystem."""
@@ -516,9 +497,9 @@ def _cparts(self):
516497 return self ._cached_cparts
517498
518499 def __eq__ (self , other ):
519- if not isinstance (other , PurePath ):
500+ if not isinstance (other , type ( self ) ):
520501 return NotImplemented
521- return self ._cparts == other ._cparts and self . _flavour is other . _flavour
502+ return self ._cparts == other ._cparts
522503
523504 def __hash__ (self ):
524505 try :
@@ -528,22 +509,22 @@ def __hash__(self):
528509 return self ._hash
529510
530511 def __lt__ (self , other ):
531- if not isinstance (other , PurePath ) or self . _flavour is not other . _flavour :
512+ if not isinstance (other , type ( self )) :
532513 return NotImplemented
533514 return self ._cparts < other ._cparts
534515
535516 def __le__ (self , other ):
536- if not isinstance (other , PurePath ) or self . _flavour is not other . _flavour :
517+ if not isinstance (other , type ( self )) :
537518 return NotImplemented
538519 return self ._cparts <= other ._cparts
539520
540521 def __gt__ (self , other ):
541- if not isinstance (other , PurePath ) or self . _flavour is not other . _flavour :
522+ if not isinstance (other , type ( self )) :
542523 return NotImplemented
543524 return self ._cparts > other ._cparts
544525
545526 def __ge__ (self , other ):
546- if not isinstance (other , PurePath ) or self . _flavour is not other . _flavour :
527+ if not isinstance (other , type ( self )) :
547528 return NotImplemented
548529 return self ._cparts >= other ._cparts
549530
@@ -779,7 +760,6 @@ class PurePosixPath(PurePath):
779760 On a POSIX system, instantiating a PurePath should return this object.
780761 However, you can also instantiate it directly on any system.
781762 """
782- _flavour = _posix_flavour
783763 _pathmod = posixpath
784764 _supported = (os .name != 'nt' )
785765 _case_insensitive = False
@@ -823,7 +803,8 @@ class PureWindowsPath(PurePath):
823803 On a Windows system, instantiating a PurePath should return this object.
824804 However, you can also instantiate it directly on any system.
825805 """
826- _flavour = _windows_flavour
806+ # Reference for Windows paths can be found at
807+ # http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx
827808 _pathmod = ntpath
828809 _supported = (os .name == 'nt' )
829810 _case_insensitive = True
0 commit comments