This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bup
Recipients bup
Date 2018-11-05.06:23:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1541398981.44.0.788709270274.issue35166@psf.upfronthosting.co.za>
In-reply-to
Content
>>> 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 

	
>>> {**Dict(a=1)}
{'a': 1}

The opcode uses PyDict_Update, which calls the internal dict_merge function which contains the following line:

    if (PyDict_Check(b) && (Py_TYPE(b)->tp_iter == (getiterfunc)dict_iter))

Translated to Python, that should be equal to 

    if type(b).__flags__ & (1<<29) and type.__getattribute__(type(b), '__iter__') is type.__getattribute__(dict, '__iter__')`

Both that and the line in C evaluate to false for me (while a dict subclass that doesn't override __iter__ evaluates to true), so I 
 apparently can't help narrow down the problem any further assuming people agree that this is even is a problem...

The BUILD_MAP_UNPACK_WITH_CALL, CALL_FUNCTION_EX, and CALL_FUNCTION_KW opcodes are affected as well.
History
Date User Action Args
2018-11-05 06:23:01bupsetrecipients: + bup
2018-11-05 06:23:01bupsetmessageid: <1541398981.44.0.788709270274.issue35166@psf.upfronthosting.co.za>
2018-11-05 06:23:01buplinkissue35166 messages
2018-11-05 06:23:00bupcreate