Closed barneygale closed 3 months ago
Tagging you @merwok in case this interests you or you have any suggestions/thoughts. Hope that's OK! Thanks.
Name ideas: flavour, format, formatter, structure, manipulator, grammar, syntax, parser
flavour, impl (for «object implementing operations»), manipulator
impl (for «object implementing operations»)
PathModuleBase
only implements pure (lexical) operations, but if it's inherited into Path
as Path.impl
, I think it would incorrectly suggest that it's used to implement all path functionality, including I/O.
Indeed, I thought it was doing that, like accessor
used to.
I don’t think it’s very bad to have pathmod
, especially if it names an object implementing a PathModuleBase ABC! If you feel that the names are misleading, both should be changed in agreement.
Hello everyone,
~If I remember correctly from the thread on discuss.python.org the name pathmod was chosen because the posixpath and ntpath modules were the two options for the path 'flavours'.~ (just saw that it's mentioned in the first post in the issue)
To me personally, "format", "flavour", "syntax" or "parser" are more intuitive.
Cheers, Andreas
I like "flavour" tbh. Antoine used "flavour" in this way too when he wrote pathlib (I/O was done by the "accessor").
So flavour
for a module with functions, or object with methods, and PathFlavourBase
for the interface (ABC) ?
Correct. Or just FlavourBase
for the ABC, I suppose.
We now have an ABC for
PurePathBase.pathmod
calledPathModuleBase
- see https://pathlib-abc.readthedocs.io/en/latest/api.html#controlling-path-syntaxThe naming here made sense for when
posixpath
andntpath
were the only possible values forpathmod
, but with the addition of thePathModuleBase
class, the "mod" bit isn't appropriate.We should rename
pathmod
andPathModuleBase
, hopefully before Python 3.13 beta 1 goes out.