ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> types-sig
types-sig
RE: [Types-sig] Re: PRE-PROPOSAL: Python Interfaces
by Tim Peters other posts by this author
Nov 25 1998 8:54PM messages near this date
RE: [Types-sig] Re: PRE-PROPOSAL: Python Interfaces | RE: [Types-sig] Re: PRE-PROPOSAL: Python Interfaces
[TimP]
>  As we discussed on the egroups version of this, if interfaces
>  allow supplying impementation, then
> 
>      from InterfaceSupport import deferred
>      class Stack(Interface):
>          def push(self, thing): deferred()
>          etc
> 
>  would make everyone who *claims* to implement Stack pick up
>  the (presumably error-raising) Stack.push "deferred()"
>  implementation if they don't supply their own (or inherit some
>  other) real implementation of push.

[BarryW]
>  That definitely does the trick, assuming we add something like
>  a NotImplementedError to the core and perhaps even a builtin
>  function deferred() that just raises the exception.  Half of me
>  wants something a little more magical (and thus less dependent
>  on the author to play> the right game)... okay make that 1/4 of
>  me.. no 1/8... urg.

7/16'ths of me too, but I believe the groundrules for the Scarecrow Proposal
include "no language changes".  That leaves manual, or at best
semi-automated, convention for now.  In a Python2 world, I doubt it would be
more of an insanely protracted battle than usual <wink>  to get a "defer"
keyword added, provided it worked out in practice by hand first.

Given "def push(self, thing): defer" we could peek at the bytecode today,
note the senseless LOAD_GLOBAL of "defer", and simply rewrite the user's
code for them <cackle> .

illness-runs-in-the-family-ly y'rs  - tim
Thread:
Barry A. Warsaw
Barry A. Warsaw
Jim Fulton
Barry A. Warsaw
Tim Peters
Tim Peters

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved