[Types-sig] Re: PRE-PROPOSAL: Python Interfaces
Jim Fulton
jim@Digicool.com
Tue, 01 Dec 1998 21:13:25 +0000
Barry A. Warsaw wrote:
>
> >>>>> "TP" == Tim Peters <tim_one@email.msn.com> writes:
>
> TP> 7/16'ths of me too, but I believe the groundrules for the
> TP> Scarecrow Proposal include "no language changes". That leaves
> TP> manual, or at best semi-automated, convention for now. In a
> TP> Python2 world, I doubt it would be more of an insanely
> TP> protracted battle than usual <wink> to get a "defer" keyword
> TP> added, provided it worked out in practice by hand first.
>
> TP> Given "def push(self, thing): defer" we could peek at the
> TP> bytecode today, note the senseless LOAD_GLOBAL of "defer", and
> TP> simply rewrite the user's code for them <cackle>.
>
> An easy change for Python 1.6 would be to add something like
> NotImplementedError to exceptions.py and a defer() builtin function.
> The latter has some potential for existing code breakage, but since
> user definitions of that attribute will silently override the builtin
> one, it's probably minimal. That might get us far enough along for
> 1.6 to play while leaving open a `defer' keyword later.
>
> So trivial to implement, I've attached a patch set (against my hacked
> 1.5.2 -- watch for fuzz factor). Extremely minimally tested. Here's
> what it looks like:
The Scarecrow implementation I posted earlier today provides this
functionality without any language or library changes.
Jim
--
Jim Fulton mailto:jim@digicool.com
Technical Director (540) 371-6909 Python Powered!
Digital Creations http://www.digicool.com http://www.python.org
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.