Marius Gedminas wrote:
> doesn't fail with an exception, I can assume that
...which in this case should return True, as None does indeed implement
the interface in question.
>> *That's* what I'm looking for help with, not judgement on whether
>> adapting to None is a good idea or not ;-)
> Could you please describe the real problem you're solving?
I have a generic IFieldType (well, could arguably be called IFieldValue)
adapter, which subclasses, eg:
class IFieldType(Interface): pass
class number(IFieldType): pass
class text(IFieldType): pass
class date(IFieldType): pass
class empty(IFieldType): pass
The idea being that you can do things like:
...and if there's an adapter for it, it gets called and you get back
something that implements IFieldType.
This couples nicely with, for example:
Now, you could, for example, then do:
...which should return None.
Simplistix - Content Management, Zope & Python Consulting
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -