New submission from Barney Gale <barney.g...@gmail.com>:

Following bpo-39899, bpo-43757 and bpo-43012, `pathlib._Flavour` and its 
subclasses are looking a bit pointless.

The implementations of `is_reserved()` and `make_uri()` (~`as_uri()`) can be 
readily moved to into `PurePosixPath` and `PureWindowsPath`, which removes some 
indirection. This follows the pattern of OS-specific stuff in `PosixPath` and 
`WindowsPath`.

The remaining methods, such as `splitroot()`, can be pulled into `Pure*Path` 
with an underscore prefix.

I'm generally a believer in composition over inheritance, but in this case 
`_Flavour` seems too small and too similar to `PurePath` to separate out into 3 
extra classes.

There should be no impact on public APIs or performance.

----------
components: Library (Lib)
messages: 393685
nosy: barneygale
priority: normal
severity: normal
status: open
title: Remove pathlib flavours
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44136>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to