[Python-Dev] defmacro (was: Anonymous blocks)

Shane Holloway (IEEE) shane.holloway at ieee.org
Mon Apr 25 21:20:51 CEST 2005



Aahz wrote:
> On Mon, Apr 25, 2005, Shane Holloway (IEEE) wrote:
> 
>>Interfaces::
>>
>>    def interface(interfaceName, *bases, ***aBlockSuite):
>>        blockGlobals = aBlockSuite.globals().copy()
>>        blockGlobals.update(aBlockSuite.locals())
>>        blockLocals = {}
>>
>>        exec aBlock in blockGlobals, blockLocals
>>
>>        return iterfaceType(interfaceName, bases, blockLocals)
>>
>>    IFoo = interface('IFoo'):
>>        def isFoo(self): pass
> 
> 
> Where does ``aBlock`` come from?

Sorry! I renamed ``aBlock`` to ``aBlockSuite``, but missed a few.  ;)


More information about the Python-Dev mailing list