Steven D'Aprano <[email protected]> added the comment:
You say it doesn't work as expected, but you don't say what you expect or why.
(Don't make me guess what you mean -- explicit is better than implicit.)
When I try your subclass in 3.6, I get an unexpected TypeError:
py> class Dict(dict):
... def keys(self): assert 0
... def update(*args, **kwds): assert 0
... def __getitem__(self, key): assert 0
... def __iter__(self): assert 0
...
py> {**Dict(a=1)}
{'a': 1}
py> Dict(a=1).keys()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in keys
TypeError
----------
nosy: +steven.daprano
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35166>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com