> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Pete > Sent: Friday, March 16, 2007 7:32 AM > To: [email protected] > Subject: Re: [pylucene-dev] why isn't my > customSimilarityobjectchangingthebehavior? > > There's no compilation - Python's entirely interpreted. > Unless you have a SyntaxError, the interpreter will let you > write whatever code you want.
I thought most modern languages were compiled internally to a bytecode representation when the script is run (I know Perl is, at least), so that's what I meant. But it doesn't much matter from our perspective. > I'd prolly do something like: > > def __init__(self, similarity=None); > similarity=similarity or PyLucene.DefaultSimilarity() > assert isinstance(similarity, PyLucene.Similarity) > # should probably name this attr 'similarity', > self.super looks weird, > # but that's just style > self.super=similarity I originally called it super because the original intent was to subclass DefaultSimilarity. Now I know that I'm supposed to achieve the same end result by decorating a java class instead of subclassing, so I'm fine with deprecating the .super notation. So, just to recap and clarify - is the above understand correct, regarding decorating instead of subclassing when it comes to PyLucene? -ofer _______________________________________________ pylucene-dev mailing list [email protected] http://lists.osafoundation.org/mailman/listinfo/pylucene-dev
