Linux server.thearyasamaj.org 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64
Apache
: 103.90.241.146 | : 216.73.216.222
Cant Read [ /etc/named.conf ]
5.6.40
ftpuser@mantra.thearyasamaj.org
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
python3-zope-interface /
docs /
[ HOME SHELL ]
Name
Size
Permission
Action
_static
[ DIR ]
drwxr-xr-x
api
[ DIR ]
drwxr-xr-x
Makefile
5.46
KB
-rw-r--r--
README.rst
24.55
KB
-rw-r--r--
README.ru.rst
33.18
KB
-rw-r--r--
adapter.rst
16.12
KB
-rw-r--r--
adapter.ru.rst
20.67
KB
-rw-r--r--
changes.rst
28
B
-rw-r--r--
conf.py
8.41
KB
-rw-r--r--
foodforthought.rst
1.7
KB
-rw-r--r--
hacking.rst
9.29
KB
-rw-r--r--
human.rst
6.39
KB
-rw-r--r--
human.ru.rst
10.43
KB
-rw-r--r--
index.rst
639
B
-rw-r--r--
make.bat
4.99
KB
-rw-r--r--
verify.rst
3.53
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : verify.rst
=================================== Verifying interface implementations =================================== The ``zope.interface.verify`` module provides functions that test whether a given interface is implemented by a class or provided by an object, resp. Verifying classes ================= This is covered by unit tests defined in ``zope.interface.tests.test_verify``. Verifying objects ================= An object provides an interface if - either its class declares that it implements the interfaces, or the object declares that it directly provides the interface; - the object defines all the methods required by the interface; - all the methods have the correct signature; - the object defines all non-method attributes required by the interface. This doctest currently covers only the latter item. Testing for attributes ---------------------- Attributes of the object, be they defined by its class or added by its ``__init__`` method, will be recognized: .. doctest:: >>> from zope.interface import Interface, Attribute, implements >>> from zope.interface.exceptions import BrokenImplementation >>> class IFoo(Interface): ... x = Attribute("The X attribute") ... y = Attribute("The Y attribute") >>> class Foo(object): ... implements(IFoo) ... x = 1 ... def __init__(self): ... self.y = 2 >>> from zope.interface.verify import verifyObject >>> verifyObject(IFoo, Foo()) True If either attribute is missing, verification will fail: .. doctest:: >>> class Foo(object): ... implements(IFoo) ... x = 1 >>> try: #doctest: +NORMALIZE_WHITESPACE +ELLIPSIS ... verifyObject(IFoo, Foo()) ... except BrokenImplementation, e: ... print str(e) An object has failed to implement interface <InterfaceClass ...IFoo> <BLANKLINE> The y attribute was not provided. <BLANKLINE> >>> class Foo(object): ... implements(IFoo) ... def __init__(self): ... self.y = 2 >>> try: #doctest: +NORMALIZE_WHITESPACE +ELLIPSIS ... verifyObject(IFoo, Foo()) ... except BrokenImplementation, e: ... print str(e) An object has failed to implement interface <InterfaceClass ...IFoo> <BLANKLINE> The x attribute was not provided. <BLANKLINE> If an attribute is implemented as a property that raises an ``AttributeError`` when trying to get its value, the attribute is considered missing: .. doctest:: >>> class IFoo(Interface): ... x = Attribute('The X attribute') >>> class Foo(object): ... implements(IFoo) ... @property ... def x(self): ... raise AttributeError >>> try: #doctest: +NORMALIZE_WHITESPACE +ELLIPSIS ... verifyObject(IFoo, Foo()) ... except BrokenImplementation, e: ... print str(e) An object has failed to implement interface <InterfaceClass ...IFoo> <BLANKLINE> The x attribute was not provided. <BLANKLINE> Any other exception raised by a property will propagate to the caller of ``verifyObject``: .. doctest:: >>> class Foo(object): ... implements(IFoo) ... @property ... def x(self): ... raise Exception >>> verifyObject(IFoo, Foo()) Traceback (most recent call last): Exception Of course, broken properties that are not required by the interface don't do any harm: .. doctest:: >>> class Foo(object): ... implements(IFoo) ... x = 1 ... @property ... def y(self): ... raise Exception >>> verifyObject(IFoo, Foo()) True
Close