[RFC] allow fulltext to be more dynamic
John Arbash Meinel
john at arbash-meinel.com
Sun Nov 26 15:18:40 GMT 2006
Martin Pool wrote:
> On 25/11/2006, at 3:53am, John Arbash Meinel wrote:
>
>> Well, at this point I'm not sure if it should be a constant. I could
>> define it at the class level, but then you are supposed to access them
>> as class-level members. So do something like:
>>
>> class KnitVersionedFile(...
>>
>> _max_delta_chain = 200
>>
>> ...
>>
>>
>> while count < KnitVersionedFile._max_delta_chain:
>> ...
>>
>> At least that is what I've understood from Martin and Robert. They don't
>> really like having class level definitions which can be overridden per
>> object and accessed as 'self._max_delta_chain'.
>
> I don't have a problem with it; in fact it seems like a decent way to
> provide a class-wide default. It can be dangerous if it's a mutable
> object, as people can accidentally change the wrong one.
>
>
> --Martin
Well, my point was I wanted something like:
class KnitVersionedFile(...
_max_delta_chain = 200
...
def set_max_delta_chain(self, max_delta):
self._max_delta_chain = max_delta
...
while count < self._max_delta_chain:
do stuff
Because it could be useful to override _max_delta_chain on a per-object
basis, or possibly per-class. I didn't think through everything
completely, so for now, I just made it a member, since that is probably
the safest default. I was under the impression that if we wrote things
as a class constant, they should be accessed through the class, not
through 'self'. Which doesn't give a chance to change it per-instance.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061126/e5e0d703/attachment.pgp
More information about the bazaar
mailing list