@@ -46,25 +46,6 @@ def _is_wildcard_pattern(pat):
46
46
return "*" in pat or "?" in pat or "[" in pat
47
47
48
48
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
-
68
49
class _Accessor :
69
50
"""An accessor implements a particular (system-specific or not) way of
70
51
accessing paths on the filesystem."""
@@ -516,9 +497,9 @@ def _cparts(self):
516
497
return self ._cached_cparts
517
498
518
499
def __eq__ (self , other ):
519
- if not isinstance (other , PurePath ):
500
+ if not isinstance (other , type ( self ) ):
520
501
return NotImplemented
521
- return self ._cparts == other ._cparts and self . _flavour is other . _flavour
502
+ return self ._cparts == other ._cparts
522
503
523
504
def __hash__ (self ):
524
505
try :
@@ -528,22 +509,22 @@ def __hash__(self):
528
509
return self ._hash
529
510
530
511
def __lt__ (self , other ):
531
- if not isinstance (other , PurePath ) or self . _flavour is not other . _flavour :
512
+ if not isinstance (other , type ( self )) :
532
513
return NotImplemented
533
514
return self ._cparts < other ._cparts
534
515
535
516
def __le__ (self , other ):
536
- if not isinstance (other , PurePath ) or self . _flavour is not other . _flavour :
517
+ if not isinstance (other , type ( self )) :
537
518
return NotImplemented
538
519
return self ._cparts <= other ._cparts
539
520
540
521
def __gt__ (self , other ):
541
- if not isinstance (other , PurePath ) or self . _flavour is not other . _flavour :
522
+ if not isinstance (other , type ( self )) :
542
523
return NotImplemented
543
524
return self ._cparts > other ._cparts
544
525
545
526
def __ge__ (self , other ):
546
- if not isinstance (other , PurePath ) or self . _flavour is not other . _flavour :
527
+ if not isinstance (other , type ( self )) :
547
528
return NotImplemented
548
529
return self ._cparts >= other ._cparts
549
530
@@ -779,7 +760,6 @@ class PurePosixPath(PurePath):
779
760
On a POSIX system, instantiating a PurePath should return this object.
780
761
However, you can also instantiate it directly on any system.
781
762
"""
782
- _flavour = _posix_flavour
783
763
_pathmod = posixpath
784
764
_supported = (os .name != 'nt' )
785
765
_case_insensitive = False
@@ -823,7 +803,8 @@ class PureWindowsPath(PurePath):
823
803
On a Windows system, instantiating a PurePath should return this object.
824
804
However, you can also instantiate it directly on any system.
825
805
"""
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
827
808
_pathmod = ntpath
828
809
_supported = (os .name == 'nt' )
829
810
_case_insensitive = True
0 commit comments