[issue41621] defaultdict miss behave when using default_factory passed as kwargs
New submission from Moshe Morad
from collections import defaultdict dd = defaultdict(default_factory=list) dd defaultdict(None, {'default_factory':
}) print(dd.default_factory) None
Analysis
--------
defdict_init(PyObject *self, PyObject *args, PyObject *kwds) function that initializing defaultdict object ignores the kwds and pass them to the dict init only.
Expect:
-------
Since we can understand why we want to move kwds to dict without modification consider at least adding comment in the docstring or enforce it as positional argument only.
----------
assignee: docs@python
components: Documentation, ctypes
messages: 375823
nosy: docs@python, moshemorad12340
priority: normal
severity: normal
status: open
title: defaultdict miss behave when using default_factory passed as kwargs
type: behavior
versions: Python 3.8
_______________________________________
Python tracker
participants (4)
-
Dennis Sweeney
-
Irit Katriel
-
Moshe Morad
-
Ronald Oussoren