home contents changes options help subscribe edit (external edit)

GOAL:

A user wants to implement an interface so that their components work as the interface describes.

In the current prototype implementation, this is done by associating a concrete class with an interface object:

from IFoo import IFoo  # see DeveloperCreatesInterface

class Foo(Bar, Baz):

  __implements__ = (IFoo,)

  def aMethod(self):
    return

  def bMethod(self):
    return

This syntax asserts that instances of the 'Foo' class will implement the 'IFoo?' interface. Another possible implemenation would be to add an additional Python keyword and syntax:

from IFoo import IFoo

class Foo(Bar, Baz) implements (IFoo,):

  def aMethod(self):
    return

  def bMethod(self):
    return

This would have the benefit of additional type checking to ensure that only Interface objects were specified as implementees.



subject:
  ( 1 subscriber )