On Sat, 23 Dec 2017 06:16:23 -0800
"Edward K. Ream" <edream...@gmail.com> wrote:

> ​Thanks for raising this topic.  I have been meaning to say a few
> deprecating words about g.Bunch myself.​

What don't you like about g.Bunch?

g.Bunch was not what I was speaking against.  The pattern I'm
finding most awkward for extension is (thing0, thing1, thing2) - a
tuple (or list) where some kind of type with named attributes / keys
would be much more extensible.  The question is how to get that for the
least cost.

I agree the attr thing was kind of a red-herring, I just added that
before reading through it.

So for example for recursiveUNLFind()'s

  return found, maxdepth, maxp

even with the brevity attr might offer, defining a class just to return
something used in very few places seems onerous.  And I think named
tuples, while better, still risk order / length dependent assignment
and unpacking which breaks extensibility.

  return {'found': found, 'maxdepth': maxdepth, 'maxp': maxp}

or

  return dict(found=found, maxdepth=maxdepth, maxp=maxp)

is much more robust, and really the cost of using d['thing0'] instead
of d.thing0 (or just thing0 from tuple unpacking) isn't that great.  I
do prefer d.thing0 though.

I guess you could also have:

  thing0, thing1, thing2 = getkeys(result, 'thing0 thing1 thing2')

but if you're going to that g.Bunch or addict.Dict probably makes more
sense.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to