[spambayes-dev] Nuke experimental_ham_spam_imbalance_adjustment?

Tim Peters tim.one at comcast.net
Sun Dec 14 19:22:42 EST 2003


[Skip Montanaro]
> ...
> If you rip out the code in classifier.py, you should be able to simply
> change its name in Options.py to
>
>     x-experimental_ham_spam_imbalance_adjustment
>
> That's how you deprecate an option based upon the code I added to
> OptionsClass.py the other day.  If the user sets "foo" but it doesn't
> exist and "x-foo" does, a message is printed to stderr, but nothing
> bombs.  Take a look at the docstring for the OptionsClass module.

Cool!  I just did that.  There's a minor problem:  the OptionsClass module
says the magic prefix is

    X-

(uppercase), but only

    x-

(lowercase) works as intended.  With

    X-experimental_ham_spam_imbalance_adjustment

the warning is

    warning: Invalid option experimental_ham_spam_imbalance_adjustment in
    section Classifier in file
    C:\WINDOWS\Application Data\SpamBayes\default_bayes_customize.ini

and with

    x-experimental_ham_spam_imbalance_adjustment

it's the mostly <wink> hoped-for

    warning: option experimental_ham_spam_imbalance_adjustment in
    section Classifier is deprecated

I'm not sure what your intent was, but the code should match the docs one
way or the other.  The second form of message should probably include the
filename too.

Works slick, though!




More information about the spambayes-dev mailing list