How to use makepy?

Alex Martelli alex at magenta.com
Mon Jul 10 05:59:39 EDT 2000


"Dale Strickland-Clark" <dale at out-think.NOSPAM.co.uk> wrote in message
news:8k9tot$5o$1 at supernews.com...
> Well, all this seemed to do was break an existing working program. I've
had
> to delete the \gen_py folder to get things working again.
>
> I am confused now.
>
> Anyone got any idea how to use makepy?

I see you're received good and helpful replies, just wanted to add one
thing: in
my limited experience, when makepy breaks working code it's most of the
time because of case-sensitivity issues.  I.e.: with late-bound Automation,
which
is what you're using absent makepy, the name of methods and properties are
matched without regard to case; once you early-bind (with makepy), case does
become significant, though.  So, if the real name of a method is Method, and
you were calling it like this:

    anobject.method()

that will break; you'll have to change the call to

    anobject.Method()


This seems unfortunate to me, but I don't see what could easily be done
about
it.  I believe case-insensitivity is in the Automation specs (by Microsoft),
maybe
because Visual Basic (for which language so much of Automation was thought
of) is also case-insensitive; but once you early-bind, if you're using a
case
sensitive language (not just Python, but also, for example, C++), then the
language's rules will prevail.  Maybe a __getattr__ override on makepy-built
objects would work, but it feels kludgey and perhaps slow, too.


Alex






More information about the Python-list mailing list