<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/zope-interface.git/src/zope/interface/tests/test_adapter.py, branch issue236</title>
<subtitle>github.com: zopefoundation/zope.interface.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/'/>
<entry>
<title>Merge pull request #233 from zopefoundation/docs-update</title>
<updated>2021-03-17T16:43:08+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2021-03-17T16:43:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=7a9fcddc22afa138244bb0664a8a792381b412f4'/>
<id>7a9fcddc22afa138244bb0664a8a792381b412f4</id>
<content type='text'>
Update the Adaptation docs to be more concrete.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update the Adaptation docs to be more concrete.</pre>
</div>
</content>
</entry>
<entry>
<title>Update the Adaptation docs to be more concrete.</title>
<updated>2021-03-17T12:39:49+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2021-03-17T12:35:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=488a317abdfa2a1fa04efd2f2d8d22a433beaaf8'/>
<id>488a317abdfa2a1fa04efd2f2d8d22a433beaaf8</id>
<content type='text'>
This should help provide better motivating use cases. Examples inspired by https://glyph.twistedmatrix.com/2021/03/interfaces-and-protocols.html

Also some minor typo fixes and updates to comments.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This should help provide better motivating use cases. Examples inspired by https://glyph.twistedmatrix.com/2021/03/interfaces-and-protocols.html

Also some minor typo fixes and updates to comments.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add IAdapterRegistry.subscribed and Components.rebuildUtilityRegistryFromLocalCache</title>
<updated>2021-03-15T14:43:24+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2021-03-15T14:43:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=50c73de0a8f8712810213bd4f1ed9c2850e1c8b2'/>
<id>50c73de0a8f8712810213bd4f1ed9c2850e1c8b2</id>
<content type='text'>
Fixes #230
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #230
</pre>
</div>
</content>
</entry>
<entry>
<title>Let subclasses of BaseAdapterRegistry customize the data structures.</title>
<updated>2021-03-03T11:07:41+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2021-02-26T21:34:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=8a8285133b6f8ddc93ac54f1af84775e1ba6f698'/>
<id>8a8285133b6f8ddc93ac54f1af84775e1ba6f698</id>
<content type='text'>
Add extensive tests for this. Fixes #224.

Also adds test for, and fixes #227

Add BAR.rebuild() to fix the refcount issue, and to change datatypes.

It works by using the new methods allRegistrations() and allSubscriptions() to re-create the data in new data structures.

This makes fresh calls to subscribe() and register(). I went this way instead of trying to manually walk the data structures and create them because the logic in those methods is fully tested.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add extensive tests for this. Fixes #224.

Also adds test for, and fixes #227

Add BAR.rebuild() to fix the refcount issue, and to change datatypes.

It works by using the new methods allRegistrations() and allSubscriptions() to re-create the data in new data structures.

This makes fresh calls to subscribe() and register(). I went this way instead of trying to manually walk the data structures and create them because the logic in those methods is fully tested.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix interface definitions of IAdapterRegistry.subscribe, subscribers and subscriptions.</title>
<updated>2020-04-23T11:14:29+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2020-04-23T11:11:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=44169e9ed26400c06e4659069e0c3ea869f40c61'/>
<id>44169e9ed26400c06e4659069e0c3ea869f40c61</id>
<content type='text'>
They were defined to accept a name argument, but the actual implementation doesn't. Add tests for this. Fixes #208.

Also in test_adapter.py modernize idioms from assertTrue(x in y) and assertTrue(x is y) to assertIn and assertIs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
They were defined to accept a name argument, but the actual implementation doesn't. Add tests for this. Fixes #208.

Also in test_adapter.py modernize idioms from assertTrue(x in y) and assertTrue(x is y) to assertIn and assertIs.
</pre>
</div>
</content>
</entry>
<entry>
<title>Let interface 'subclasses' override __adapt__.</title>
<updated>2020-04-06T14:14:45+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2020-04-03T14:55:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=10eadd6305ee57910dbcc508b293f4bf0364fd84'/>
<id>10eadd6305ee57910dbcc508b293f4bf0364fd84</id>
<content type='text'>
Cooperate with InterfaceClass to ensure there is no performance penalty for this. Fixes #3

+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| Benchmark                                                   | bench_master38 | bench_issue3                 | bench_issue3_opt             |
+=============================================================+================+==============================+==============================+
| call interface (provides; deep)                             | 369 ns         | 454 ns: 1.23x slower (+23%)  | not significant              |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| call interface (provides; wide)                             | 373 ns         | 457 ns: 1.22x slower (+22%)  | 365 ns: 1.02x faster (-2%)   |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| call interface (no alternate, no conform, not provided)     | 671 ns         | 760 ns: 1.13x slower (+13%)  | 636 ns: 1.06x faster (-5%)   |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| call interface (alternate, no conform, not provided)        | 395 ns         | 494 ns: 1.25x slower (+25%)  | not significant              |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| call interface (no alternate, valid conform, not provided)  | 250 ns         | not significant              | 227 ns: 1.10x faster (-9%)   |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| call interface (alternate, invalid conform, not provided)   | 348 ns         | 424 ns: 1.22x slower (+22%)  | not significant              |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cooperate with InterfaceClass to ensure there is no performance penalty for this. Fixes #3

+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| Benchmark                                                   | bench_master38 | bench_issue3                 | bench_issue3_opt             |
+=============================================================+================+==============================+==============================+
| call interface (provides; deep)                             | 369 ns         | 454 ns: 1.23x slower (+23%)  | not significant              |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| call interface (provides; wide)                             | 373 ns         | 457 ns: 1.22x slower (+22%)  | 365 ns: 1.02x faster (-2%)   |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| call interface (no alternate, no conform, not provided)     | 671 ns         | 760 ns: 1.13x slower (+13%)  | 636 ns: 1.06x faster (-5%)   |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| call interface (alternate, no conform, not provided)        | 395 ns         | 494 ns: 1.25x slower (+25%)  | not significant              |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| call interface (no alternate, valid conform, not provided)  | 250 ns         | not significant              | 227 ns: 1.10x faster (-9%)   |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
| call interface (alternate, invalid conform, not provided)   | 348 ns         | 424 ns: 1.22x slower (+22%)  | not significant              |
+-------------------------------------------------------------+----------------+------------------------------+------------------------------+
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove the bare except: statements.</title>
<updated>2020-04-02T12:53:05+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2020-04-02T12:53:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=84872a8d2ab6b980aebc1c3c1ffb6aee9cf97ea5'/>
<id>84872a8d2ab6b980aebc1c3c1ffb6aee9cf97ea5</id>
<content type='text'>
Only catch AttributeError instead of everything.

Fixes #200

Note that this does break a doctest in five.intid (it's expecting a TypeError but it now gets Acquisition's RuntimeError).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only catch AttributeError instead of everything.

Fixes #200

Note that this does break a doctest in five.intid (it's expecting a TypeError but it now gets Acquisition's RuntimeError).
</pre>
</div>
</content>
</entry>
<entry>
<title>Add additional low-level tests for super() unwrapping.</title>
<updated>2020-03-10T10:57:39+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2020-03-10T10:57:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=fb8180d4521dc7333498731d1361a82d0034582b'/>
<id>fb8180d4521dc7333498731d1361a82d0034582b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>The _empty singleton has no-op subscribe/unsubscribe methods.</title>
<updated>2020-01-28T22:04:31+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2020-01-28T22:04:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=97997956d1a17a0cfb064dfe0487291e8f8ee181'/>
<id>97997956d1a17a0cfb064dfe0487291e8f8ee181</id>
<content type='text'>
Turns out they can be called in some very strange error cases. See #162 and #163 for details.

This should fix #162 (at least the provided test case, five.intid, passes now).

It also does enough work on #163 that (a) the test can be written and run in pure-python mode, which was needed to debug it and (b) five.intid runs in pure-python mode (well, with a bunch of other small hacks to Acquisition, ExtensionClass, DocumentTemplate and AccessControl), but I won't claim that it fully fixes #163. For one thing, there are no specific tests. For another, I see more such differences.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Turns out they can be called in some very strange error cases. See #162 and #163 for details.

This should fix #162 (at least the provided test case, five.intid, passes now).

It also does enough work on #163 that (a) the test can be written and run in pure-python mode, which was needed to debug it and (b) five.intid runs in pure-python mode (well, with a bunch of other small hacks to Acquisition, ExtensionClass, DocumentTemplate and AccessControl), but I won't claim that it fully fixes #163. For one thing, there are no specific tests. For another, I see more such differences.
</pre>
</div>
</content>
</entry>
<entry>
<title>Test PURE_PYTHON at runtime.</title>
<updated>2020-01-21T15:38:45+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2020-01-21T13:59:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=e76d03f51909c2b3f8cdad38eb91fa5f523b5e2e'/>
<id>e76d03f51909c2b3f8cdad38eb91fa5f523b5e2e</id>
<content type='text'>
Turns out that the C extensions build and work fine with PyPy, but don't use them by default. Let them
be forced, though.

Tests needed some refactoring to account for the various permutations.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Turns out that the C extensions build and work fine with PyPy, but don't use them by default. Let them
be forced, though.

Tests needed some refactoring to account for the various permutations.
</pre>
</div>
</content>
</entry>
</feed>
