[issue29847] Path takes and ignores **kwargs

Serhiy Storchaka report at bugs.python.org
Tue Mar 21 13:25:34 EDT 2017


Serhiy Storchaka added the comment:

I don't know whether it was the intension of Antoine or just an oversight. I don't know whether it is used in the wild. But we can at least raise a TypeError for concrete classes PosixPath and WindowsPath if ignoring keyword arguments is a problem. Many extension types don't take keyword arguments, but their subclasses accept and ignore keyword arguments. For example:

>>> filter(None, [], foo=123)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: filter() does not take keyword arguments
>>> class X(filter): pass
... 
>>> X(None, [], foo=123)
<__main__.X object at 0xb6fdcacc>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29847>
_______________________________________


More information about the Python-bugs-list mailing list