Whither SmallScript? (was Re: Integer micro-benchmarks)

Greg Ewing see at my.signature
Tue May 1 00:49:37 EDT 2001


Andrew Hunt wrote:
> 
> Here, class Foo inherits from class Bar.  Except that class Bar is just an
> expression that returns a Class object.  In this case it's a constant, but
> you could just as easily have:
> 
> class Foo < someMagicRoutine(someArgument, somethingElse)

Just thought I'd check whether Python can do this
too, and it can:

Python 1.5.2 (#1, Nov 29 1999, 13:42:43)  [GCC 2.8.1] on sunos5
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> class Bar:
...  pass
... 
>>> def f():
...  return Bar
... 
>>> class Foo(f()):
...  pass
... 
>>> 

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list