[Checkins] SVN: zope.interface/branches/gary-crazy-experiments/src/zope/interface/ tests pass (I thought I had done this already...)
Gary Poster
gary.poster at canonical.com
Tue Oct 6 21:36:46 EDT 2009
Log message for revision 104848:
tests pass (I thought I had done this already...)
Changed:
U zope.interface/branches/gary-crazy-experiments/src/zope/interface/README.ru.txt
U zope.interface/branches/gary-crazy-experiments/src/zope/interface/README.txt
U zope.interface/branches/gary-crazy-experiments/src/zope/interface/interface.py
U zope.interface/branches/gary-crazy-experiments/src/zope/interface/tests/test_adapter.py
U zope.interface/branches/gary-crazy-experiments/src/zope/interface/tests/unitfixtures.py
U zope.interface/branches/gary-crazy-experiments/src/zope/interface/verify.txt
-=-
Modified: zope.interface/branches/gary-crazy-experiments/src/zope/interface/README.ru.txt
===================================================================
--- zope.interface/branches/gary-crazy-experiments/src/zope/interface/README.ru.txt 2009-10-06 20:28:49 UTC (rev 104847)
+++ zope.interface/branches/gary-crazy-experiments/src/zope/interface/README.ru.txt 2009-10-07 01:36:46 UTC (rev 104848)
@@ -38,10 +38,10 @@
клаÑÑа `zope.interface.Interface`, коÑоÑÑй ÑвлÑеÑÑÑ ÑодиÑелÑÑким инÑеÑÑейÑом
Ð´Ð»Ñ Ð²ÑеÑ
инÑеÑÑейÑов, как `object` - ÑÑо ÑодиÑелÑÑкий клаÑÑ Ð´Ð»Ñ Ð²ÑеÑ
новÑÑ
клаÑÑов [#create]_. ÐаннÑй инÑеÑÑÐµÐ¹Ñ Ð½Ðµ ÑвлÑеÑÑÑ ÐºÐ»Ð°ÑÑом, а ÑвлÑеÑÑÑ
-ÐнÑеÑÑейÑом, ÑкземплÑÑом `InterfaceClass`::
+ÐнÑеÑÑейÑом, ÑкземплÑÑом `InterfaceMetaclass`::
>>> type(IFoo)
- <class 'zope.interface.interface.InterfaceClass'>
+ <class 'zope.interface.interface.InterfaceMetaclass'>
ÐÑ Ð¼Ð¾Ð¶ÐµÐ¼ запÑоÑиÑÑ Ñ Ð¸Ð½ÑеÑÑейÑа его докÑменÑаÑиÑ::
@@ -116,7 +116,7 @@
>>> IFoo.x
Traceback (most recent call last):
File "<stdin>", line 1, in ?
- AttributeError: 'InterfaceClass' object has no attribute 'x'
+ AttributeError: type object 'IFoo' has no attribute 'x'
ÐеÑÐ¾Ð´Ñ Ñакже пÑедоÑÑавлÑÑÑ Ð´Ð¾ÑÑÑп к ÑигнаÑÑÑе меÑода::
@@ -193,7 +193,7 @@
ÐÑ Ð¼Ð¾Ð¶ÐµÐ¼ Ñакже ÑзнаÑÑ ÐºÐ°ÐºÐ¸Ðµ инÑеÑÑейÑÑ ÑеализÑÑÑÑÑ Ð¾Ð±ÑекÑами::
>>> list(zope.interface.implementedBy(Foo))
- [<InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.IFoo>]
ÐÑо оÑибка ÑпÑаÑиваÑÑ Ð¿Ñо инÑеÑÑейÑÑ ÑеализÑемÑе не вÑзÑваемÑм обÑекÑом::
@@ -210,7 +210,7 @@
Также можно ÑзнаÑÑ ÐºÐ°ÐºÐ¸Ðµ инÑеÑÑейÑÑ Ð¿ÑедоÑÑавлÑÑÑÑÑ Ð¾Ð±ÑекÑами::
>>> list(zope.interface.providedBy(foo))
- [<InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.IFoo>]
>>> list(zope.interface.providedBy(Foo))
[]
@@ -225,7 +225,7 @@
>>> yfoo = zope.interface.implementer(IFoo)(yfoo)
>>> list(zope.interface.implementedBy(yfoo))
- [<InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.IFoo>]
Ðадо замеÑиÑÑ, ÑÑо декоÑаÑÐ¾Ñ implementer Ð¼Ð¾Ð¶ÐµÑ Ð¼Ð¾Ð´Ð¸ÑиÑиÑоваÑÑ Ñвои аÑгÑменÑÑ.
ÐÑзÑваÑÑÐ°Ñ ÑÑоÑона не должна пÑедполагаÑÑ, ÑÑо вÑегда бÑÐ´ÐµÑ ÑоздаваÑÑÑÑ
@@ -267,7 +267,7 @@
ТепеÑÑ Ð¼Ñ Ð²Ð¸Ð´Ð¸Ð¼, ÑÑо Foo Ñже пÑедоÑÑавлÑÐµÑ Ð¸Ð½ÑеÑÑейÑÑ::
>>> list(zope.interface.providedBy(Foo))
- [<InterfaceClass __main__.IFooFactory>]
+ [<InterfaceMetaclass __main__.IFooFactory>]
>>> IFooFactory.providedBy(Foo)
True
@@ -289,7 +289,7 @@
... return "Foo(%s)" % self.x
>>> list(zope.interface.providedBy(Foo2))
- [<InterfaceClass __main__.IFooFactory>]
+ [<InterfaceMetaclass __main__.IFooFactory>]
>>> IFooFactory.providedBy(Foo2)
True
@@ -328,13 +328,13 @@
>>> ISpecial.providedBy(foo)
True
>>> list(zope.interface.providedBy(foo))
- [<InterfaceClass __main__.ISpecial>, <InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.ISpecial>, <InterfaceMetaclass __main__.IFoo>]
ÐÑ Ñакже можем опÑеделиÑÑ, ÑÑо инÑеÑÑейÑÑ Ð½Ð°Ð¿ÑÑмÑÑ Ð¿ÑедоÑÑавлÑÑÑÑÑ
обÑекÑами::
>>> list(zope.interface.directlyProvidedBy(foo))
- [<InterfaceClass __main__.ISpecial>]
+ [<InterfaceMetaclass __main__.ISpecial>]
>>> newfoo = Foo()
>>> list(zope.interface.directlyProvidedBy(newfoo))
@@ -352,10 +352,10 @@
... return "I'm special because %s" % self.reason
>>> list(zope.interface.implementedBy(SpecialFoo))
- [<InterfaceClass __main__.ISpecial>, <InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.ISpecial>, <InterfaceMetaclass __main__.IFoo>]
>>> list(zope.interface.providedBy(SpecialFoo()))
- [<InterfaceClass __main__.ISpecial>, <InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.ISpecial>, <InterfaceMetaclass __main__.IFoo>]
Ðногда Ð¼Ñ Ð½Ðµ Ñ
оÑим наÑледоваÑÑ Ð¾Ð±ÑÑвлениÑ. Ð ÑÑом ÑлÑÑае Ð¼Ñ Ð¼Ð¾Ð¶ÐµÐ¼
иÑполÑзоваÑÑ `implementsOnly` вмеÑÑо `implements`::
@@ -367,10 +367,10 @@
... return "I'm special because %s" % self.reason
>>> list(zope.interface.implementedBy(Special))
- [<InterfaceClass __main__.ISpecial>]
+ [<InterfaceMetaclass __main__.ISpecial>]
>>> list(zope.interface.providedBy(Special()))
- [<InterfaceClass __main__.ISpecial>]
+ [<InterfaceMetaclass __main__.ISpecial>]
ÐнеÑние обÑÑвлениÑ
------------------
@@ -385,7 +385,7 @@
>>> zope.interface.classImplements(C, IFoo)
>>> list(zope.interface.implementedBy(C))
- [<InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.IFoo>]
ÐÑ Ð¼Ð¾Ð¶ÐµÐ¼ иÑполÑзоваÑÑ `classImplementsOnly` Ð´Ð»Ñ Ð¸ÑклÑÑÐµÐ½Ð¸Ñ Ð½Ð°ÑледÑемÑÑ
инÑеÑÑейÑов::
@@ -395,7 +395,7 @@
>>> zope.interface.classImplementsOnly(C, ISpecial)
>>> list(zope.interface.implementedBy(C))
- [<InterfaceClass __main__.ISpecial>]
+ [<InterfaceMetaclass __main__.ISpecial>]
ÐбÑекÑÑ Ð¾Ð±ÑÑвлений
------------------
@@ -425,7 +425,7 @@
инÑеÑÑейÑов в иÑоговом обÑÑвлениÑ::
>>> list(zope.interface.implementedBy(Special2))
- [<InterfaceClass __main__.IFoo>, <InterfaceClass __main__.ISpecial>]
+ [<InterfaceMetaclass __main__.IFoo>, <InterfaceMetaclass __main__.ISpecial>]
ÐаÑледование инÑеÑÑейÑов
========================
@@ -441,7 +441,7 @@
... """eek blah blah"""
>>> IBlat.__bases__
- (<InterfaceClass zope.interface.Interface>,)
+ (<InterfaceMetaclass zope.interface.Interface>,)
>>> class IBaz(IFoo, IBlat):
... """Baz blah"""
@@ -450,7 +450,7 @@
...
>>> IBaz.__bases__
- (<InterfaceClass __main__.IFoo>, <InterfaceClass __main__.IBlat>)
+ (<InterfaceMetaclass __main__.IFoo>, <InterfaceMetaclass __main__.IBlat>)
>>> names = list(IBaz)
>>> names.sort()
@@ -550,7 +550,7 @@
>>> baz_implements = zope.interface.implementedBy(Baz)
>>> baz_implements.__bases__
- (<InterfaceClass __main__.IBaz>,)
+ (<InterfaceMetaclass __main__.IBaz>,)
>>> baz_implements.extends(IFoo)
True
@@ -565,10 +565,10 @@
>>> baz_implements.__sro__
(<implementedBy __main__.Baz>,
- <InterfaceClass __main__.IBaz>,
- <InterfaceClass __main__.IFoo>,
- <InterfaceClass __main__.IBlat>,
- <InterfaceClass zope.interface.Interface>)
+ <InterfaceMetaclass __main__.IBaz>,
+ <InterfaceMetaclass __main__.IFoo>,
+ <InterfaceMetaclass __main__.IBlat>,
+ <InterfaceMetaclass zope.interface.Interface>)
ÐомеÑеннÑе знаÑениÑ
===================
@@ -598,7 +598,7 @@
... __call__.return_type = IBaz
>>> IBazFactory['__call__'].getTaggedValue('return_type')
- <InterfaceClass __main__.IBaz>
+ <InterfaceMetaclass __main__.IBaz>
ÐомеÑеннÑе знаÑÐµÐ½Ð¸Ñ Ñакже могÑÑ Ð±ÑÑÑ Ð¾Ð¿ÑÐµÐ´ÐµÐ»ÐµÐ½Ñ Ð²Ð½ÑÑÑи опÑеделениÑ
инÑеÑÑейÑа::
@@ -683,7 +683,7 @@
>>> I(0)
Traceback (most recent call last):
...
- TypeError: ('Could not adapt', 0, <InterfaceClass __main__.I>)
+ TypeError: ('Could not adapt', 0, <InterfaceMetaclass __main__.I>)
ÑолÑко еÑли алÑÑеÑнаÑивное знаÑение не пеÑедано как вÑоÑой аÑгÑменÑ::
@@ -725,7 +725,7 @@
>>> I(0)
Traceback (most recent call last):
...
- TypeError: ('Could not adapt', 0, <InterfaceClass __main__.I>)
+ TypeError: ('Could not adapt', 0, <InterfaceMetaclass __main__.I>)
__adapt__
Modified: zope.interface/branches/gary-crazy-experiments/src/zope/interface/README.txt
===================================================================
--- zope.interface/branches/gary-crazy-experiments/src/zope/interface/README.txt 2009-10-06 20:28:49 UTC (rev 104847)
+++ zope.interface/branches/gary-crazy-experiments/src/zope/interface/README.txt 2009-10-07 01:36:46 UTC (rev 104848)
@@ -32,14 +32,14 @@
... def bar(q, r=None):
... """bar blah blah"""
-In the example above, we've created an interface, `IFoo`. We
-subclassed `zope.interface.Interface`, which is an ancestor interface for
-all interfaces, much as `object` is an ancestor of all new-style
-classes [#create]_. The interface is not a class, it's an Interface,
-an instance of `InterfaceClass`::
+In the example above, we've created an interface, `IFoo`. We subclassed
+`zope.interface.Interface`, which is an ancestor interface for all
+interfaces, much as `object` is an ancestor of all new-style classes
+[#create]_. The interface is not a standard Python class, but an
+Interface, an instance of `InterfaceMetaclass`::
>>> type(IFoo)
- <class 'zope.interface.interface.InterfaceClass'>
+ <class 'zope.interface.interface.InterfaceMetaclass'>
We can ask for the interface's documentation::
@@ -105,13 +105,13 @@
>>> names
['bar', 'x']
-Remember that interfaces aren't classes. You can't access attribute
-definitions as attributes of interfaces::
+Remember that interfaces do not provide the API they describe. You can't
+access attribute definitions as attributes of interfaces::
>>> IFoo.x
Traceback (most recent call last):
File "<stdin>", line 1, in ?
- AttributeError: 'InterfaceClass' object has no attribute 'x'
+ AttributeError: type object 'IFoo' has no attribute 'x'
Methods provide access to the method signature::
@@ -193,7 +193,7 @@
We can also ask what interfaces are implemented by an object::
>>> list(zope.interface.implementedBy(Foo))
- [<InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.IFoo>]
It's an error to ask for interfaces implemented by a non-callable
object::
@@ -211,7 +211,7 @@
Similarly, we can ask what interfaces are provided by an object::
>>> list(zope.interface.providedBy(foo))
- [<InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.IFoo>]
>>> list(zope.interface.providedBy(Foo))
[]
@@ -226,7 +226,7 @@
>>> yfoo = zope.interface.implementer(IFoo)(yfoo)
>>> list(zope.interface.implementedBy(yfoo))
- [<InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.IFoo>]
Note that the implementer decorator may modify it's argument. Callers
should not assume that a new object is created.
@@ -267,7 +267,7 @@
And then, we'll see that Foo provides some interfaces::
>>> list(zope.interface.providedBy(Foo))
- [<InterfaceClass __main__.IFooFactory>]
+ [<InterfaceMetaclass __main__.IFooFactory>]
>>> IFooFactory.providedBy(Foo)
True
@@ -289,7 +289,7 @@
... return "Foo(%s)" % self.x
>>> list(zope.interface.providedBy(Foo2))
- [<InterfaceClass __main__.IFooFactory>]
+ [<InterfaceMetaclass __main__.IFooFactory>]
>>> IFooFactory.providedBy(Foo2)
True
@@ -328,12 +328,12 @@
>>> ISpecial.providedBy(foo)
True
>>> list(zope.interface.providedBy(foo))
- [<InterfaceClass __main__.ISpecial>, <InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.ISpecial>, <InterfaceMetaclass __main__.IFoo>]
We can find out what interfaces are directly provided by an object::
>>> list(zope.interface.directlyProvidedBy(foo))
- [<InterfaceClass __main__.ISpecial>]
+ [<InterfaceMetaclass __main__.ISpecial>]
>>> newfoo = Foo()
>>> list(zope.interface.directlyProvidedBy(newfoo))
@@ -351,10 +351,10 @@
... return "I'm special because %s" % self.reason
>>> list(zope.interface.implementedBy(SpecialFoo))
- [<InterfaceClass __main__.ISpecial>, <InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.ISpecial>, <InterfaceMetaclass __main__.IFoo>]
>>> list(zope.interface.providedBy(SpecialFoo()))
- [<InterfaceClass __main__.ISpecial>, <InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.ISpecial>, <InterfaceMetaclass __main__.IFoo>]
Sometimes, you don't want to inherit declarations. In that case, you
can use `implementsOnly`, instead of `implements`::
@@ -366,10 +366,10 @@
... return "I'm special because %s" % self.reason
>>> list(zope.interface.implementedBy(Special))
- [<InterfaceClass __main__.ISpecial>]
+ [<InterfaceMetaclass __main__.ISpecial>]
>>> list(zope.interface.providedBy(Special()))
- [<InterfaceClass __main__.ISpecial>]
+ [<InterfaceMetaclass __main__.ISpecial>]
External declarations
---------------------
@@ -385,7 +385,7 @@
>>> zope.interface.classImplements(C, IFoo)
>>> list(zope.interface.implementedBy(C))
- [<InterfaceClass __main__.IFoo>]
+ [<InterfaceMetaclass __main__.IFoo>]
We can use `classImplementsOnly` to exclude inherited interfaces::
@@ -394,7 +394,7 @@
>>> zope.interface.classImplementsOnly(C, ISpecial)
>>> list(zope.interface.implementedBy(C))
- [<InterfaceClass __main__.ISpecial>]
+ [<InterfaceMetaclass __main__.ISpecial>]
@@ -426,7 +426,7 @@
interfaces in the resulting declaration is different::
>>> list(zope.interface.implementedBy(Special2))
- [<InterfaceClass __main__.IFoo>, <InterfaceClass __main__.ISpecial>]
+ [<InterfaceMetaclass __main__.IFoo>, <InterfaceMetaclass __main__.ISpecial>]
Interface Inheritance
@@ -443,7 +443,7 @@
... """eek blah blah"""
>>> IBlat.__bases__
- (<InterfaceClass zope.interface.Interface>,)
+ (<InterfaceMetaclass zope.interface.Interface>,)
>>> class IBaz(IFoo, IBlat):
... """Baz blah"""
@@ -452,7 +452,7 @@
...
>>> IBaz.__bases__
- (<InterfaceClass __main__.IFoo>, <InterfaceClass __main__.IBlat>)
+ (<InterfaceMetaclass __main__.IFoo>, <InterfaceMetaclass __main__.IBlat>)
>>> names = list(IBaz)
>>> names.sort()
@@ -552,7 +552,7 @@
>>> baz_implements = zope.interface.implementedBy(Baz)
>>> baz_implements.__bases__
- (<InterfaceClass __main__.IBaz>,)
+ (<InterfaceMetaclass __main__.IBaz>,)
>>> baz_implements.extends(IFoo)
True
@@ -567,10 +567,10 @@
>>> baz_implements.__sro__
(<implementedBy __main__.Baz>,
- <InterfaceClass __main__.IBaz>,
- <InterfaceClass __main__.IFoo>,
- <InterfaceClass __main__.IBlat>,
- <InterfaceClass zope.interface.Interface>)
+ <InterfaceMetaclass __main__.IBaz>,
+ <InterfaceMetaclass __main__.IFoo>,
+ <InterfaceMetaclass __main__.IBlat>,
+ <InterfaceMetaclass zope.interface.Interface>)
Tagged Values
@@ -601,7 +601,7 @@
... __call__.return_type = IBaz
>>> IBazFactory['__call__'].getTaggedValue('return_type')
- <InterfaceClass __main__.IBaz>
+ <InterfaceMetaclass __main__.IBaz>
Tagged values can also be defined from within an interface definition::
@@ -688,7 +688,7 @@
>>> I(0)
Traceback (most recent call last):
...
- TypeError: ('Could not adapt', 0, <InterfaceClass __main__.I>)
+ TypeError: ('Could not adapt', 0, <InterfaceMetaclass __main__.I>)
@@ -731,7 +731,7 @@
>>> I(0)
Traceback (most recent call last):
...
- TypeError: ('Could not adapt', 0, <InterfaceClass __main__.I>)
+ TypeError: ('Could not adapt', 0, <InterfaceMetaclass __main__.I>)
__adapt__
---------
Modified: zope.interface/branches/gary-crazy-experiments/src/zope/interface/interface.py
===================================================================
--- zope.interface/branches/gary-crazy-experiments/src/zope/interface/interface.py 2009-10-06 20:28:49 UTC (rev 104847)
+++ zope.interface/branches/gary-crazy-experiments/src/zope/interface/interface.py 2009-10-07 01:36:46 UTC (rev 104848)
@@ -197,7 +197,7 @@
adapter = hook(self, obj)
if adapter is not None:
return adapter
-
+
InterfaceBase = InterfaceBasePy
adapter_hooks = []
@@ -449,8 +449,10 @@
if attrs is None:
attrs = {}
- if not bases: # (I.e., this is the root "interface.")
- del attrs['__metaclass__'] # Interfaces don't want "real" attrs.
+ if not bases: # (That is, this is the root "interface" instance, or a
+ # test fixture.)
+ # Interfaces don't want "real" attrs.
+ attrs.pop('__metaclass__', None)
if __module__ is None:
__module__ = attrs.get('__module__')
@@ -707,8 +709,7 @@
return c > 0
-class Interface:
- __metaclass__ = InterfaceMetaclass
+Interface = InterfaceMetaclass("Interface", __module__ = 'zope.interface')
class Attribute(Element):
Modified: zope.interface/branches/gary-crazy-experiments/src/zope/interface/tests/test_adapter.py
===================================================================
--- zope.interface/branches/gary-crazy-experiments/src/zope/interface/tests/test_adapter.py 2009-10-06 20:28:49 UTC (rev 104847)
+++ zope.interface/branches/gary-crazy-experiments/src/zope/interface/tests/test_adapter.py 2009-10-07 01:36:46 UTC (rev 104848)
@@ -94,17 +94,17 @@
def test_multi_adapter_w_default():
"""
>>> registry = AdapterRegistry()
-
+
>>> registry.register([None, None], IB1, 'bob', 'A0')
>>> registry.lookup((IF1, IR1), IB0, 'bob')
'A0'
-
+
>>> registry.register([None, IR0], IB1, 'bob', 'A1')
>>> registry.lookup((IF1, IR1), IB0, 'bob')
'A1'
-
+
>>> registry.lookup((IF1, IR1), IB0, 'bruce')
>>> registry.register([None, IR1], IB1, 'bob', 'A2')
@@ -192,7 +192,7 @@
"""
>>> registry = AdapterRegistry()
>>> default = object()
-
+
>>> class Object1(object):
... zope.interface.implements(IF0)
>>> class Object2(object):
@@ -255,7 +255,7 @@
...
TypeError: ('Could not adapt',
<zope.interface.tests.test_adapter.X object at ...>,
- <InterfaceClass zope.interface.tests.test_adapter.IY>)
+ <InterfaceMetaclass zope.interface.tests.test_adapter.IY>)
But after we declare an interface on the class `X`, it should pass:
Modified: zope.interface/branches/gary-crazy-experiments/src/zope/interface/tests/unitfixtures.py
===================================================================
--- zope.interface/branches/gary-crazy-experiments/src/zope/interface/tests/unitfixtures.py 2009-10-06 20:28:49 UTC (rev 104847)
+++ zope.interface/branches/gary-crazy-experiments/src/zope/interface/tests/unitfixtures.py 2009-10-07 01:36:46 UTC (rev 104848)
@@ -16,7 +16,7 @@
$Id$
"""
from zope.interface import Interface, invariant
-from zope.interface.interface import Attribute
+from zope.interface.interface import Attribute, InterfaceMetaclass
from zope.interface.exceptions import Invalid
class mytest(Interface):
@@ -112,11 +112,11 @@
class Blah(object):
pass
-new = Interface.__class__
-FunInterface = new('FunInterface')
-BarInterface = new('BarInterface', [FunInterface])
-BobInterface = new('BobInterface')
-BazInterface = new('BazInterface', [BobInterface, BarInterface])
+FunInterface = InterfaceMetaclass('FunInterface')
+BarInterface = InterfaceMetaclass('BarInterface', [FunInterface])
+BobInterface = InterfaceMetaclass('BobInterface')
+BazInterface = InterfaceMetaclass('BazInterface',
+ [BobInterface, BarInterface])
# fixtures for invariant tests
def ifFooThenBar(obj):
@@ -130,8 +130,8 @@
foo = getattr(obj, 'foo', None)
bar = getattr(obj, 'bar', None)
if foo is not None and isinstance(foo, type(bar)):
- # type checking should be handled elsewhere (like, say,
- # schema); these invariants should be intra-interface
+ # type checking should be handled elsewhere (like, say,
+ # schema); these invariants should be intra-interface
# constraints. This is a hacky way to do it, maybe, but you
# get the idea
if not bar > foo:
Modified: zope.interface/branches/gary-crazy-experiments/src/zope/interface/verify.txt
===================================================================
--- zope.interface/branches/gary-crazy-experiments/src/zope/interface/verify.txt 2009-10-06 20:28:49 UTC (rev 104847)
+++ zope.interface/branches/gary-crazy-experiments/src/zope/interface/verify.txt 2009-10-07 01:36:46 UTC (rev 104848)
@@ -57,7 +57,7 @@
>>> verifyObject(IFoo, Foo())
Traceback (most recent call last):
-BrokenImplementation: An object has failed to implement interface <InterfaceClass __builtin__.IFoo>
+BrokenImplementation: An object has failed to implement interface <InterfaceMetaclass __builtin__.IFoo>
The y attribute was not provided.
>>> class Foo(object):
@@ -67,7 +67,7 @@
>>> verifyObject(IFoo, Foo())
Traceback (most recent call last):
-BrokenImplementation: An object has failed to implement interface <InterfaceClass __builtin__.IFoo>
+BrokenImplementation: An object has failed to implement interface <InterfaceMetaclass __builtin__.IFoo>
The x attribute was not provided.
If an attribute is implemented as a property that raises an AttributeError
@@ -84,7 +84,7 @@
>>> verifyObject(IFoo, Foo())
Traceback (most recent call last):
-BrokenImplementation: An object has failed to implement interface <InterfaceClass __builtin__.IFoo>
+BrokenImplementation: An object has failed to implement interface <InterfaceMetaclass __builtin__.IFoo>
The x attribute was not provided.
Any other exception raised by a property will propagate to the caller of
More information about the checkins
mailing list