Dan Price wrote:

>   http://cr.opensolaris.org/~dp/pkg-mem/

Nice.  Very simple.

I'm a bit confused about the protocol between __new__() and __init__().
>From the datamodel doc page, __init__() is called if __new__() returns an
instance of the class.  Which you do, so that's presumably when the
"dotstring" argument to __new__() is used.  But since you're protecting
yourself against a second call, where does that second call come from?

You create a custom __setattr__() and __delattr__() to make the instances
immutable, but since this class derives from list, not tuple, do you do
anything to prevent the mutations lists typically allow?  Should you define
__setitem__() and __delitem__()?  Or should the class simply inherit from
tuple?

I assume that _dotseq_pool is intended to be class-private.  If so, it
should start with a double-underscore.

In __setattr__, the name of the class should have a capital S.

In the perf test, you might get slightly more accurate numbers if you use
xrange() (a generator) instead of range() (a list), at least for the
1..10000 case.  Or you could predefine all three lists before getting
startusage.  Or maybe all that is in the noise.

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

Reply via email to