ANN: visage (interfaces)

jwp james.pye at gmail.com
Sun Aug 12 19:07:14 EDT 2012


On Sunday, July 29, 2012 10:18:23 PM UTC-7, jwp wrote:
> What's c.l.py's perspective on managing interfaces and implementations?

I pushed another version with support for IID references, so you can refer to implementations in annotations. The ultimate point of this is to give registry queries the ability to check for implementations with particular features:

@visage.lib.implementation('foo')
class Imp(object):
 def meth(self) -> visage.lib.reference('bar'):
  ...

Imp.meth making a statement that a 'bar' implementation will be returned.

That is, consider code that is not aware of the modules that "Imp" is stored in but wants a 'foo' implementation whose "meth" method returns a 'bar' instance. Registry queries pave the way for supporting IID based implementation resolution. There is also the potential that registry information could be extracted on package installation for the purpose of an implementation index. Implementations could be imported on demand by modules that have no knowledge of the implementation.



More information about the Python-list mailing list