>
> $ def unpack_set():
> > return {*()}
> >
> $ dis.dis(unpack_set)
> 2 0 BUILD_SET 0
> 2 LOAD_CONST 1 (())
> 4 SET_UPDATE 1
> 6 RETURN_VALUE
>
Seems like the peephole optimizer could be trained to easily recognize that
the LOAD_CONST/SET_UPDATE pair will be a no-op.
Skip
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/OVFLVPSKHJWZ5FYDELRCXP66JCQUL33G/
Code of Conduct: http://python.org/psf/codeofconduct/