documentation of _immutable_?
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@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
On Tue, Oct 30, 2012 at 12:19 AM,
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@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net _______________________________________________ pypy-dev mailing list pypy-dev@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 :)
On Tue, Oct 30, 2012 at 1:15 AM, Maciej Fijalkowski
On Tue, Oct 30, 2012 at 12:19 AM,
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@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net _______________________________________________ pypy-dev mailing list pypy-dev@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.
Hi Maciej,
A very short answer is "never use _immutable_ it's very confusing".
that I found out the hard way already. :)
_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.
I've also seen an '?' appended to field names? But it is the last set of
rules that I'm interested in (the "if" portion of the rule in particular).
Something like it seems to have bit me: there was a field that was constant
only by inheritance of _immutable_ = True, but it didn't hurt until the
container variable received a jit.promote(). With both in place, I got
wrong results. With the promote() removed, I got:
[bogus _immutable_field_ declaration:
participants (2)
-
Maciej Fijalkowski
-
wlavrijsen@lbl.gov