[issue29847] Path takes and ignores **kwargs

Rémi Lapeyre report at bugs.python.org
Thu May 21 07:56:21 EDT 2020


Rémi Lapeyre <remi.lapeyre at henki.fr> 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 <report at bugs.python.org>
<https://bugs.python.org/issue29847>
_______________________________________


More information about the Python-bugs-list mailing list