Announcing bytecodehacks 0.10
Michael Hudson
mwh21 at cam.ac.uk
Thu May 13 14:52:29 EDT 1999
Christian Tismer <tismer at appliedbiometrics.com> writes:
> I've modified setq a little, since I think setq'ers
> always know what they do, I added code to support
> setq being the first appearance of the variable.
> This means, setq always makes a variable local.
>
> Example:
>
> >>> def f(x):
> ... for i in range(len(x)):
> ... if setq(c, x[i]) == 3:
> ... print c, 42
> ...
> >>> x=setq2.setqize(f)
> load found at index 13
> found call
> turned first arg c into a local
> >>> x(range(10))
> 3 42
>
> cheers - chris (setq2.py attached)
>
Ah, I was going to do that at some point. Now I don't have to :-). The
examples been snitched for the docs as well.
Thanks very much.
Michael
More information about the Python-list
mailing list