On Thu, Sep 8, 2011 at 7:35 PM, mdb <[email protected]> wrote:
> In a Leo script I find a portion of my outline and create a generator
>
> pa= p.self_and_subtree()
The Leonine solution is:
for p2 in p.copy().self_and_subtree():
This does not advance p, so you are free later to do whatever you want
with p. The code creates no unnecessary explicit iter object.
Finally, the name p2 (rather than px) is a standard coding convention
that allows more autocompleter completions for "p2.".
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.