Method binding confusion

Dave Brueck dave at pythonapocrypha.com
Sat May 22 16:10:28 EDT 2004


David MacQuigg wrote:
> All functions and methods *should* be unified.  See the section
> "Unification of all function forms" in PrototypeSyntax.doc at
> http://www.ece.arizona.edu/~edatools/Python

That's cool that you've taken the time to gather your thoughts onto some pages
that anyone can view. One thing that might make them even more useful to
illustrate your point would be to have a page that shows unification in the
absense of the other changes you're proposing (in the page listed above, the
reader has to set aside prototypes and miscellaneous syntax changes and try to
focus on just function/method unification).

Also, such a page would really benefit from a few simple but uncontrived
examples of how things work now, and how they'd work after your proposed
changes. From reading that page, I'm not entirely sure how the tasks I
currently solve with bound methods, unbound methods, static functions, etc.
would work under the new system - many people learn best by example, but that
page illustrates (as far as I can tell) how only one method of calling would be
affected, and the example is obscured by unrelated syntax languages.

So, for example, find the two or three most common use cases of unbound
methods, and simplify the examples to make them concise but not so far that
they becomes overly contrived (in the math example you've posted a few times, I
have a hard time imagining why I'd ever want to do that, so to me it's not very
compelling). Show the code for the implementation as well as how the calls
happen. Then show the same for how things would look after your changes. Repeat
this whole process for all calling conventions that would be affected.

Short of this, the ability to convince people will be limited - the problem you
cite doesn't seem to affect me much in day-to-day development, and I haven't
seen it be a big hangup for people learning the language (most don't
notice/care, the rest get past it almost instantly with the simplest of
explanations). If on top of that it's also unclear to me how I'd get the same
things done if the language were changed (and it _is_ unclear to me), then it's
hard to maintain interest in this topic.

Good luck!
-Dave





More information about the Python-list mailing list