◐ Shell
clean mode source ↗

GH-100502: Add `pathlib.PurePath.pathmod` attribute by barneygale · Pull Request #106533 · python/cpython

This instance attribute stores the implementation of `os.path` used for
low-level path operations: either `posixpath` or `ntpath`.

The `PurePath` and `Path` initialisers gain a *flavour* keyword-only
argument. This argument is not available in the Posix- and Windows-specific
subclasses, and as the `PurePath` and `Path` classes are not directly
instantiable, it is available therefore only in user subclasses of
`PurePath` and `Path`. Such subclasses may determine their flavour in
`__init__()` and supply the flavour to `super()`.

@barneygale

merwok

@barneygale barneygale changed the title GH-100502: Add pathlib.PurePath.flavour attribute GH-100502: Add pathlib.PurePath.pathmod attribute

Jul 9, 2023

@ap-- ap-- mentioned this pull request

Aug 28, 2023

barneygale added a commit to barneygale/cpython that referenced this pull request

Dec 19, 2023