[Python-3000] Dict literal bytecode

Adam Olsen rhamph at gmail.com
Tue Mar 25 22:06:48 CET 2008


On Tue, Mar 25, 2008 at 2:43 PM, Alexander Belopolsky
<alexander.belopolsky at gmail.com> wrote:
> On Tue, Mar 25, 2008 at 4:26 PM, Adam Olsen <rhamph at gmail.com> wrote:
> > It does not even have to be a frozenset. A set works just as well,
> > never modified by the produced bytecode.
>> With the current implementation, precomputed constants must be
> hashable because the compiler uses a dictionary lookup in order to
> eliminate duplicates. This is of course just an implementation
> detail, but it would actually be hard to work around it.

Only builtin types with literal syntax may be deemed "constant"
anyway. I fail to see how that's relevant to my frozenset vs set
comment.
-- 
Adam Olsen, aka Rhamphoryncus


More information about the Python-3000 mailing list

AltStyle によって変換されたページ (->オリジナル) /