New submission from Moshe Morad <moshemorad12...@gmail.com>:
How to reproduce ---------------- >>> from collections import defaultdict >>> dd = defaultdict(default_factory=list) >>> dd defaultdict(None, {'default_factory': <class 'list'>}) >>> 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 <rep...@bugs.python.org> <https://bugs.python.org/issue41621> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com