[pypy-dev] documentation of _immutable_?

Maciej Fijalkowski fijall at gmail.com
Tue Oct 30 00:17:49 CET 2012


On Tue, Oct 30, 2012 at 1:15 AM, Maciej Fijalkowski <fijall at gmail.com> wrote:
> On Tue, Oct 30, 2012 at 12:19 AM,  <wlavrijsen at lbl.gov> wrote:
>> Hi,
>>
>> any place where I can find docs describing _immutable_ and
>> _immutable_fields_
>> in some detail? As it happens, they don't quite do what I expected, which
>> led
>> to bugs. I'd like to know what their scope is and what the wildcards do.
>>
>> Right now I just removed them all to be safe (and allow some
>> experimentation).
>> But that is costing performance (20% extra overhead).
>>
>> Also, I see _attrs_ in quite a few places. What is it for?
>>
>> Thanks,
>>      Wim
>> --
>> WLavrijsen at lbl.gov    --    +1 (510) 486 6411    --    www.lavrijsen.net
>> _______________________________________________
>> pypy-dev mailing list
>> pypy-dev at python.org
>> http://mail.python.org/mailman/listinfo/pypy-dev
>
> Hi Wim.
>
> I'll write some docs for them later this week, this is a bit embarrasing :)

A very short answer is "never use _immutable_ it's very confusing".
_immutable_fields_ is better (for subclassing) Wildcards mean "array
on the instance is immutable" so a[*] means x.a[3] will be constant
folded, if x is a constant.


More information about the pypy-dev mailing list