Rémi Lapeyre <[email protected]> added the comment:
PurePath subclasses cannot support kwargs as __new__() does not accept **kwargs:
>>> from pathlib import PurePath
>>> class MyPurePath(PurePath):
... def __init__(self, *args, **kargs): pass
...
>>> MyPurePath('foo', spam=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __new__() got an unexpected keyword argument 'spam'
The behaviour for this should probably be made the same for both Path and
PurePath.
----------
nosy: +remi.lapeyre
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue29847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com