[issue42043] zipfile.Path should support inheritance

2020-10-15 Thread Étienne Pot
New submission from Étienne Pot : Currently, zipfile.Path inheritance behavior is inconsistent with pathlib.Path: ``` class MyPath(zipfile.Path): pass path = MyPath(zf) path = path.joinpath('other') assert isinstance(path, MyPath) # Oups, type(path) is zipfile.Path ``` Call

[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__

2020-08-08 Thread Étienne Pot
Étienne Pot added the comment: Before solving this issue, I think it would be best to think on a more generic solution on how to make Pathlib more extensible. Related to: https://discuss.python.org/t/make-pathlib-extensible/3428 For instance, if childs created with `p.parent()`, `p / 's

[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__

2020-06-24 Thread Étienne Pot
Étienne Pot added the comment: Note that this likely affect all methods which returns new Path by calling `_from_parts` or `_from_parsed_parts`, like `.absolute`, `.resolve`,... -- ___ Python tracker <https://bugs.python.org/issue41

[issue41109] subclasses of pathlib.PurePosixPath never call __init__ or __new__

2020-06-24 Thread Étienne Pot
New submission from Étienne Pot : I have a subclass GithubPath of PurePosixPath. ``` class GithubPath(pathlib.PurePosixPath): def __new__(cls, *args, **kwargs): print('New') return super().__new__(cls, *args, **kwargs) def __init__(self, *args, **kwargs): p