Skip to content

Instantly share code, notes, and snippets.

@jean
Last active August 29, 2015 14:08
Show Gist options
  • Save jean/b59c2b74e17bbe487091 to your computer and use it in GitHub Desktop.
Save jean/b59c2b74e17bbe487091 to your computer and use it in GitHub Desktop.
First shot at making indexer decorator chainable
class indexer(adapter):
[...]
def __call__(self, callable):
if type(callable) is DelegatingIndexerFactory:
factory = DelegatingIndexerFactory(callable.callable)
else:
factory = DelegatingIndexerFactory(callable)
adapted = adapter.__call__(self, factory)
print 'indexer.__call__', self, callable, factory, adapted #DBG
return adapted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment