rfc: Change get_parent_map signature so that no parents is ()

John Arbash Meinel john at arbash-meinel.com
Tue Jul 22 16:52:44 BST 2008

Hash: SHA1

Aaron Bentley wrote:
| John Arbash Meinel wrote:
|> If we prefer, we could have it return 2 values
|> ~  present_map, ghosts = get_XXXX()
| I find multiple return values somewhat cumbersome, and it's clear that
| the additional return value would not provide new information.  So I
| would prefer to only have a map returned, unless checking for ghosts is
| overwhelmingly common.
| Aaron

Well it is implicitly done by the _StackedParentsProvider which is
rather common.

Also, it is the difference between:

while iterating:
~  # this isn't present skip it

And then latter having to do a set difference and

while iterating:
~  # this isn't present add it to the ghosts and continue

And then just having it.

So it is more of: the underlying code has already done all the work to
determine what you might be looking for, and instead of throwing that
all away in favor of doing an O(N?) set difference later, just pass it
up the stack.

Maybe as an optional parameter indicating that you want the information?
Like we have with "Graph.find_unique_lca(..., count_steps=??)" though
I'm probably at least as unhappy with functions changing their signature
based on parameters (except when we have to for backwards compatibility.)

Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list