On Mon, Jan 12, 2009 at 05:39:25PM -0600, Shawn Walker wrote:

> http://cr.opensolaris.org/~swalker/pkg-5999-6010-2/

version.py:

  - line 115-120: can be done by calling DotSequence's dotsequence_val()
    method.

  - line 122: this should be completely shareable with DotSequence.  The
    superclass would need to call self.dotsequence_val() like you do here,
    and the second exception would need to create the string with
    self.__class__.__name__, but I think it would work.

  - line 145: isn't the "*" in self[-1] case already covered?  If self is
    "3.2.4" and other is "3.2.4.3", then ls == 3, and we trigger the
    exception on i == 3, but we already know that self[-1] == self[2] !=
    "*" because we looked at it on the previous iteration of the loop (when
    i == 2).

    I would also argue that "3.2.4" doesn't match "3.2.4.*", which I think
    this implies.

  - line 531: caching the string representation of the version really was
    that much of a speedup?

  - get_short_version(): Why is this copied from Version?  With the
    exception of the test, it's identical, and if you need a specific test
    against None (do you?), couldn't that just move into Version?

  - ditto set_timestamp()

  - get_timestamp(): If you reorder the tests, you could reuse
    super.get_timestamp().

  - __lt__(), __gt__(): I guess this won't happen much, but if you compare
    two MatchingVersion objects that have asterisks for, say, release
    values, self will always compare less than other, even if it's got a
    greater, say, branch value.  This may not be worth fixing.

  - __cmp__() looks identical.

Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to