[issue24132] Direct sub-classing of pathlib.Path

Christophe BAL report at bugs.python.org
Wed Mar 28 06:19:33 EDT 2018


Christophe BAL <projetmbc at gmail.com> added the comment:

Hello.

What about AbstractPath instead of _PurePath ?

Le 28/03/2018 à 02:30, qb-cea a écrit :
> qb-cea <quentin.bouget at cea.fr> added the comment:
>
> Hi all,
>
> I made a pull request proposing a fix for this issue. There is still quite a lot to be done:
>   - I exposed some variables (and probably methods too) that used to be hidden;
>   - I did not update the documentation;
>   - I did not add a proper test.
>
> I will try to fix those by the end of the week.
>
> The patch mainly consists of two things:
>   - having Path (resp. PurePath) be a variable pointing at either (Pure)PosixPath or (Pure)WindowsPath, depending on the platform (like Kevin Norris suggested);
>   - introducing two new abstract classes _PurePath and ConcretePath from which PurePosixPath, PureWindowsPath and PosixPath, WindowsPath classes inherit;
>   - removing the _Flavor classes, and redistributing their method to platform-specific classes.
>
> Ideally I would like _PurePath to become a public class, but I could not come up with a proper name. Any feedback is more than welcome =]
>
> ----------
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue24132>
> _______________________________________

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24132>
_______________________________________


More information about the Python-bugs-list mailing list