PyDispatcher 2.0.7__tar.gz → 2.0.9a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/PKG-INFO +30 -4
  2. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/PyDispatcher.egg-info/PKG-INFO +30 -4
  3. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/PyDispatcher.egg-info/SOURCES.txt +3 -0
  4. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/README.md +19 -0
  5. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/index.html +10 -0
  6. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/__init__.py +1 -1
  7. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/builddocs.py +1 -2
  8. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/pydispatch.__init__.html +4 -3
  9. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/pydispatch.html +4 -3
  10. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/pydispatch.robustapply.html +8 -2
  11. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/pydoc2.py +29 -8
  12. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/weakref.html +1 -1
  13. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/examples/extra_args.py +1 -1
  14. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/examples/hello_messages.py +1 -1
  15. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/examples/simple_sample.py +1 -1
  16. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/pydispatch/__init__.py +2 -1
  17. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/pydispatch/dispatcher.py +136 -64
  18. pydispatcher-2.0.9a1/pydispatch/py.typed +0 -0
  19. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/pydispatch/robust.py +10 -8
  20. pydispatcher-2.0.9a1/pydispatch/robustapply.py +133 -0
  21. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/pydispatch/saferef.py +64 -39
  22. pydispatcher-2.0.9a1/pyproject.toml +85 -0
  23. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/setup.py +0 -1
  24. pydispatcher-2.0.9a1/tests/conftest.py +20 -0
  25. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/tests/test_dispatcher.py +50 -7
  26. pydispatcher-2.0.9a1/tests/test_packaging.py +41 -0
  27. pydispatcher-2.0.9a1/tests/test_robustapply.py +87 -0
  28. pydispatcher-2.0.9a1/tests/test_robustapply_py3_8.py +61 -0
  29. pydispatcher-2.0.9a1/tests/test_saferef.py +129 -0
  30. PyDispatcher-2.0.7/pydispatch/robustapply.py +0 -55
  31. PyDispatcher-2.0.7/pyproject.toml +0 -25
  32. PyDispatcher-2.0.7/tests/test_packaging.py +0 -12
  33. PyDispatcher-2.0.7/tests/test_robustapply.py +0 -27
  34. PyDispatcher-2.0.7/tests/test_saferef.py +0 -76
  35. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/MANIFEST.in +0 -0
  36. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/PyDispatcher.egg-info/dependency_links.txt +0 -0
  37. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/PyDispatcher.egg-info/requires.txt +0 -0
  38. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/PyDispatcher.egg-info/top_level.txt +0 -0
  39. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/images/greypinstripe.png +0 -0
  40. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/pydispatch.dispatcher.html +0 -0
  41. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/pydispatch.errors.html +0 -0
  42. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/pydispatch.robust.html +0 -0
  43. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/pydoc/pydispatch.saferef.html +0 -0
  44. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/docs/style/sitestyle.css +0 -0
  45. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/examples/__init__.py +0 -0
  46. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/examples/minimal.py +0 -0
  47. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/license.txt +0 -0
  48. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/pydispatch/errors.py +0 -0
  49. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/setup.cfg +0 -0
  50. {PyDispatcher-2.0.7 → pydispatcher-2.0.9a1}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PyDispatcher
3
- Version: 2.0.7
3
+ Version: 2.0.9a1
4
4
  Summary: Multi-producer multi-consumer in-memory signal dispatch system
5
5
  Home-page: https://github.com/mcfletch/pydispatcher
6
6
  Download-URL: https://pypi.org/project/pydispatcher/
@@ -11,13 +11,20 @@ License: BSD
11
11
  Keywords: dispatcher,dispatch,pydispatch,event,signal,sender,receiver,propagate,multi-consumer,multi-producer,saferef,robustapply,apply
12
12
  Platform: Any
13
13
  Classifier: License :: OSI Approved :: BSD License
14
- Classifier: Programming Language :: Python
15
- Classifier: Programming Language :: Python :: 2
16
14
  Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
17
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
22
  Classifier: Intended Audience :: Developers
23
+ Requires-Python: >=3.9
19
24
  Description-Content-Type: text/markdown
20
25
  Provides-Extra: dev
26
+ Requires-Dist: tox; extra == "dev"
27
+ Dynamic: download-url
21
28
 
22
29
  # PyDispatcher Multi-producer Multi-consumer Observables
23
30
 
@@ -61,3 +68,22 @@ dispatcher.connect(callback, sender=MyNode, signal=metaKey)
61
68
  dispatcher.send(metaKey, MyNode, event=event)
62
69
  ```
63
70
 
71
+
72
+ ## Scaling
73
+
74
+ Two structures keep dispatch cost proportional to the work a signal actually
75
+ implies rather than to the size of the program around it.
76
+
77
+ **Wiring many receivers to one sender.** `connect()` guards against registering
78
+ the same receiver twice for a `(sender, signal)` pair. An index of what is
79
+ already registered answers that in constant time, so wiring N receivers to a
80
+ shared sender costs O(N) rather than O(N²). The index is an optimisation hint:
81
+ every real registration records itself there, so "not registered" is always
82
+ trustworthy, and a stale "registered" costs one scan and nothing else.
83
+
84
+ **Calling a receiver.** `robustApply` passes a receiver only the arguments it
85
+ will accept, which means knowing its parameters. Those come from the receiver's
86
+ code object, which never changes, so they are derived once and reused --
87
+ `robustapply.SIGNATURE_CACHE_SIZE` bounds how many are remembered. A call with
88
+ no keyword arguments needs no signature at all, since there is nothing to
89
+ subset.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PyDispatcher
3
- Version: 2.0.7
3
+ Version: 2.0.9a1
4
4
  Summary: Multi-producer multi-consumer in-memory signal dispatch system
5
5
  Home-page: https://github.com/mcfletch/pydispatcher
6
6
  Download-URL: https://pypi.org/project/pydispatcher/
@@ -11,13 +11,20 @@ License: BSD
11
11
  Keywords: dispatcher,dispatch,pydispatch,event,signal,sender,receiver,propagate,multi-consumer,multi-producer,saferef,robustapply,apply
12
12
  Platform: Any
13
13
  Classifier: License :: OSI Approved :: BSD License
14
- Classifier: Programming Language :: Python
15
- Classifier: Programming Language :: Python :: 2
16
14
  Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
17
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
22
  Classifier: Intended Audience :: Developers
23
+ Requires-Python: >=3.9
19
24
  Description-Content-Type: text/markdown
20
25
  Provides-Extra: dev
26
+ Requires-Dist: tox; extra == "dev"
27
+ Dynamic: download-url
21
28
 
22
29
  # PyDispatcher Multi-producer Multi-consumer Observables
23
30
 
@@ -61,3 +68,22 @@ dispatcher.connect(callback, sender=MyNode, signal=metaKey)
61
68
  dispatcher.send(metaKey, MyNode, event=event)
62
69
  ```
63
70
 
71
+
72
+ ## Scaling
73
+
74
+ Two structures keep dispatch cost proportional to the work a signal actually
75
+ implies rather than to the size of the program around it.
76
+
77
+ **Wiring many receivers to one sender.** `connect()` guards against registering
78
+ the same receiver twice for a `(sender, signal)` pair. An index of what is
79
+ already registered answers that in constant time, so wiring N receivers to a
80
+ shared sender costs O(N) rather than O(N²). The index is an optimisation hint:
81
+ every real registration records itself there, so "not registered" is always
82
+ trustworthy, and a stale "registered" costs one scan and nothing else.
83
+
84
+ **Calling a receiver.** `robustApply` passes a receiver only the arguments it
85
+ will accept, which means knowing its parameters. Those come from the receiver's
86
+ code object, which never changes, so they are derived once and reused --
87
+ `robustapply.SIGNATURE_CACHE_SIZE` bounds how many are remembered. A call with
88
+ no keyword arguments needs no signature at all, since there is nothing to
89
+ subset.
@@ -31,11 +31,14 @@ examples/simple_sample.py
31
31
  pydispatch/__init__.py
32
32
  pydispatch/dispatcher.py
33
33
  pydispatch/errors.py
34
+ pydispatch/py.typed
34
35
  pydispatch/robust.py
35
36
  pydispatch/robustapply.py
36
37
  pydispatch/saferef.py
37
38
  tests/__init__.py
39
+ tests/conftest.py
38
40
  tests/test_dispatcher.py
39
41
  tests/test_packaging.py
40
42
  tests/test_robustapply.py
43
+ tests/test_robustapply_py3_8.py
41
44
  tests/test_saferef.py
@@ -40,3 +40,22 @@ dispatcher.connect(callback, sender=MyNode, signal=metaKey)
40
40
  dispatcher.send(metaKey, MyNode, event=event)
41
41
  ```
42
42
 
43
+
44
+ ## Scaling
45
+
46
+ Two structures keep dispatch cost proportional to the work a signal actually
47
+ implies rather than to the size of the program around it.
48
+
49
+ **Wiring many receivers to one sender.** `connect()` guards against registering
50
+ the same receiver twice for a `(sender, signal)` pair. An index of what is
51
+ already registered answers that in constant time, so wiring N receivers to a
52
+ shared sender costs O(N) rather than O(N²). The index is an optimisation hint:
53
+ every real registration records itself there, so "not registered" is always
54
+ trustworthy, and a stale "registered" costs one scan and nothing else.
55
+
56
+ **Calling a receiver.** `robustApply` passes a receiver only the arguments it
57
+ will accept, which means knowing its parameters. Those come from the receiver's
58
+ code object, which never changes, so they are derived once and reused --
59
+ `robustapply.SIGNATURE_CACHE_SIZE` bounds how many are remembered. A call with
60
+ no keyword arguments needs no signature at all, since there is nothing to
61
+ subset.
@@ -212,6 +212,16 @@ objects.
212
212
  <h2>Release Notes</h2>
213
213
 
214
214
  <ul>
215
+ <li>Version 2.0.8
216
+ <ul>
217
+ <li>Python3.8 positional-only and keyword-only robustapply fixes (allows use of keyword only arguments in handlers)</li>
218
+ <li>Prevent the passing of keywords that match positional-only parameters, or the varargs or varnames parameter names. Note that this is only enforced if there is no varnames.</li>
219
+ </ul>
220
+ </li>
221
+ <li>Version 2.0.7
222
+ <ul>
223
+ </ul>
224
+ </li>
215
225
  <li>Version 2.0.6
216
226
  <ul>
217
227
  <li>Packaging fixes, updates to documentation and metadata.</li>
@@ -4,4 +4,4 @@ This package is based on the standard pydoc package,
4
4
  with a few minor enhancements, and a slightly modified
5
5
  format. An automatic mechanism for generating extensive
6
6
  documentation for the OpenGLContext project is provided.
7
- """
7
+ """
@@ -16,11 +16,10 @@ if __name__ == "__main__":
16
16
  modules = [
17
17
  "pydispatch",
18
18
  "weakref",
19
- ]
19
+ ]
20
20
  pydoc2.PackageDocumentationGenerator(
21
21
  baseModules = modules,
22
22
  destinationDirectory = ".",
23
23
  exclusions = excludes,
24
24
  recursionStops = stops,
25
25
  ).process ()
26
-
@@ -6,7 +6,7 @@
6
6
  <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
7
7
  <tr bgcolor="#7799ee">
8
8
  <td valign=bottom>&nbsp;<br>
9
- <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="pydispatch.html"><font color="#ffffff">pydispatch</font></a>.__init__</strong></big></big> (version 2.0.6)</font></td
9
+ <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="pydispatch.html"><font color="#ffffff">pydispatch</font></a>.__init__</strong></big></big> (version 2.0.8)</font></td
10
10
  ><td align=right valign=bottom
11
11
  ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/__init__.py">/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/__init__.py</a></font></td></tr></table>
12
12
  <p><tt>Multi-consumer&nbsp;multi-producer&nbsp;dispatching&nbsp;mechanism</tt></p>
@@ -20,12 +20,13 @@
20
20
  <td width="100%"><strong>__author__</strong> = "Patrick K. O'Brien"<br>
21
21
  <strong>__cached__</strong> = '/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/__pycache__/__init__.cpython-310.pyc'<br>
22
22
  <strong>__file__</strong> = '/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/__init__.py'<br>
23
- <strong>__license__</strong> = 'BSD-style, see license.txt for details'<br>
23
+ <strong>__license__</strong> = 'BSD'<br>
24
24
  <strong>__loader__</strong> = &lt;_frozen_importlib_external.SourceFileLoader object&gt;<br>
25
+ <strong>__maintainer__</strong> = 'Mike C. Fletcher'<br>
25
26
  <strong>__name__</strong> = 'pydispatch.__init__'<br>
26
27
  <strong>__package__</strong> = 'pydispatch'<br>
27
28
  <strong>__spec__</strong> = ModuleSpec(name='pydispatch.__init__', loader=&lt;_.../OpenGL-dev/pydispatcher/pydispatch/__init__.py')<br>
28
- <strong>__version__</strong> = '2.0.6'</td></tr></table><p>
29
+ <strong>__version__</strong> = '2.0.8'</td></tr></table><p>
29
30
  <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
30
31
  <tr bgcolor="#7799ee">
31
32
  <td colspan=3 valign=bottom>&nbsp;<br>
@@ -6,7 +6,7 @@
6
6
  <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
7
7
  <tr bgcolor="#7799ee">
8
8
  <td valign=bottom>&nbsp;<br>
9
- <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>pydispatch</strong></big></big> (version 2.0.6)</font></td
9
+ <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>pydispatch</strong></big></big> (version 2.0.8)</font></td
10
10
  ><td align=right valign=bottom
11
11
  ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/__init__.py">/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/__init__.py</a></font></td></tr></table>
12
12
  <p><tt>Multi-consumer&nbsp;multi-producer&nbsp;dispatching&nbsp;mechanism</tt></p>
@@ -27,13 +27,14 @@
27
27
  <td width="100%"><strong>__author__</strong> = "Patrick K. O'Brien"<br>
28
28
  <strong>__cached__</strong> = '/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/__pycache__/__init__.cpython-310.pyc'<br>
29
29
  <strong>__file__</strong> = '/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/__init__.py'<br>
30
- <strong>__license__</strong> = 'BSD-style, see license.txt for details'<br>
30
+ <strong>__license__</strong> = 'BSD'<br>
31
31
  <strong>__loader__</strong> = &lt;_frozen_importlib_external.SourceFileLoader object&gt;<br>
32
+ <strong>__maintainer__</strong> = 'Mike C. Fletcher'<br>
32
33
  <strong>__name__</strong> = 'pydispatch'<br>
33
34
  <strong>__package__</strong> = 'pydispatch'<br>
34
35
  <strong>__path__</strong> = ['/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch']<br>
35
36
  <strong>__spec__</strong> = ModuleSpec(name='pydispatch', loader=&lt;_frozen_im...me/mcfletch/OpenGL-dev/pydispatcher/pydispatch'])<br>
36
- <strong>__version__</strong> = '2.0.6'</td></tr></table><p>
37
+ <strong>__version__</strong> = '2.0.8'</td></tr></table><p>
37
38
  <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
38
39
  <tr bgcolor="#7799ee">
39
40
  <td colspan=3 valign=bottom>&nbsp;<br>
@@ -36,7 +36,11 @@ returns&nbsp;(function_or_method,&nbsp;codeObject,&nbsp;fromMethod)<br>
36
36
  &nbsp;<br>
37
37
  If&nbsp;fromMethod&nbsp;is&nbsp;true,&nbsp;then&nbsp;the&nbsp;callable&nbsp;already<br>
38
38
  has&nbsp;its&nbsp;first&nbsp;argument&nbsp;bound</tt></dd></dl>
39
- <dl><dt><a name="-robustApply"><strong>robustApply</strong></a>(receiver, *arguments, **named)</dt><dd><tt>Call&nbsp;receiver&nbsp;with&nbsp;arguments&nbsp;and&nbsp;an&nbsp;appropriate&nbsp;subset&nbsp;of&nbsp;named</tt></dd></dl>
39
+ <dl><dt><a name="-robustApply"><strong>robustApply</strong></a>(receiver, *arguments, **named)</dt><dd><tt>Call&nbsp;receiver&nbsp;with&nbsp;arguments&nbsp;and&nbsp;an&nbsp;appropriate&nbsp;subset&nbsp;of&nbsp;named<br>
40
+ &nbsp;<br>
41
+ The&nbsp;effect&nbsp;of&nbsp;this&nbsp;wrapper&nbsp;is&nbsp;to&nbsp;allow&nbsp;for&nbsp;specifying&nbsp;a&nbsp;large&nbsp;number<br>
42
+ of&nbsp;parameters&nbsp;which&nbsp;may&nbsp;not&nbsp;exist&nbsp;in&nbsp;the&nbsp;final&nbsp;function&nbsp;via&nbsp;named<br>
43
+ parameters,&nbsp;and&nbsp;have&nbsp;those&nbsp;parameters&nbsp;ignored&nbsp;in&nbsp;the&nbsp;final&nbsp;call.</tt></dd></dl>
40
44
  </td></tr></table><p>
41
45
  <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
42
46
  <tr bgcolor="#55aa55">
@@ -44,7 +48,9 @@ has&nbsp;its&nbsp;first&nbsp;argument&nbsp;bound</tt></dd></dl>
44
48
  <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
45
49
 
46
50
  <tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
47
- <td width="100%"><strong>__cached__</strong> = '/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/__pycache__/robustapply.cpython-310.pyc'<br>
51
+ <td width="100%"><strong>VAR_ARGS</strong> = 4<br>
52
+ <strong>VAR_NAMES</strong> = 8<br>
53
+ <strong>__cached__</strong> = '/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/__pycache__/robustapply.cpython-310.pyc'<br>
48
54
  <strong>__file__</strong> = '/home/mcfletch/OpenGL-dev/pydispatcher/pydispatch/robustapply.py'<br>
49
55
  <strong>__loader__</strong> = &lt;_frozen_importlib_external.SourceFileLoader object&gt;<br>
50
56
  <strong>__name__</strong> = 'pydispatch.robustapply'<br>
@@ -1,10 +1,31 @@
1
1
  """Pydoc sub-class for generating documentation for entire packages"""
2
- import pydoc, inspect, os, string
3
- import sys, imp, os, stat, re, types, inspect
4
- from reprlib import Repr
2
+ import pydoc
3
+ import inspect
4
+ import os
5
+ import sys
5
6
 
6
7
 
7
8
  class DefaultFormatter(pydoc.HTMLDoc):
9
+ def heading(self, *args):
10
+ try:
11
+ return super().heading(*args)
12
+ except TypeError:
13
+ # Python 3.11 doesn't use the color args
14
+ args = list(args)
15
+ del args[1:3]
16
+ return super().heading(*args)
17
+
18
+ def section(self, *args):
19
+ try:
20
+ # Python 3.11 uses a class instead of colors
21
+ py311_args = list(args)
22
+ del py311_args[1:3]
23
+ cls = '-'.join(['section', *(args[0].lower().split())])
24
+ py311_args.insert(1, cls)
25
+ return super().section(*py311_args)
26
+ except TypeError:
27
+ return super().section(*args)
28
+
8
29
  def docmodule(self, object, name=None, mod=None, packageContext=None, *ignored):
9
30
  """Produce HTML documentation for a module object."""
10
31
  name = object.__name__ # ignore the passed-in name
@@ -155,7 +176,7 @@ class DefaultFormatter(pydoc.HTMLDoc):
155
176
  modpkgs.append((file, object.__name__, 1, 0))
156
177
  modpkgs.sort()
157
178
  # do more recursion here...
158
- for (modname, name, ya, yo) in modpkgs:
179
+ for (modname, _name, _ya, _yo) in modpkgs:
159
180
  packageContext.addInteresting(".".join((object.__name__, modname)))
160
181
  items = []
161
182
  for (modname, name, ispackage, isshadowed) in modpkgs:
@@ -178,7 +199,7 @@ class DefaultFormatter(pydoc.HTMLDoc):
178
199
  items.append(
179
200
  self.modpkglink((modname, name, ispackage, isshadowed))
180
201
  )
181
- except:
202
+ except Exception:
182
203
  items.append(
183
204
  self.modpkglink((modname, name, ispackage, isshadowed))
184
205
  )
@@ -242,7 +263,7 @@ class PackageDocumentationGenerator:
242
263
  for exclusion in exclusions:
243
264
  try:
244
265
  self.exclusions[exclusion] = pydoc.locate(exclusion)
245
- except pydoc.ErrorDuringImport as value:
266
+ except pydoc.ErrorDuringImport:
246
267
  self.warn(
247
268
  """Unable to import the module %s which was specified as an exclusion module"""
248
269
  % (repr(exclusion))
@@ -264,7 +285,7 @@ class PackageDocumentationGenerator:
264
285
  try:
265
286
  self.baseSpecifiers[specifier] = pydoc.locate(specifier)
266
287
  self.pending.append(specifier)
267
- except pydoc.ErrorDuringImport as value:
288
+ except pydoc.ErrorDuringImport:
268
289
  self.warn(
269
290
  """Unable to import the module %s which was specified as a base module"""
270
291
  % (repr(specifier))
@@ -368,7 +389,7 @@ class PackageDocumentationGenerator:
368
389
  def recurseScan(self, objectList):
369
390
  """Process the list of modules trying to add each to the
370
391
  list of interesting modules"""
371
- for key, value in objectList:
392
+ for _key, value in objectList:
372
393
  self.addInteresting(value.__name__)
373
394
 
374
395
 
@@ -884,5 +884,5 @@ reference&nbsp;to&nbsp;the&nbsp;proxy&nbsp;when&nbsp;'<a href="builtins.html#obj
884
884
  <strong>__file__</strong> = '/usr/lib/python3.10/weakref.py'<br>
885
885
  <strong>__loader__</strong> = &lt;_frozen_importlib_external.SourceFileLoader object&gt;<br>
886
886
  <strong>__name__</strong> = 'weakref'<br>
887
- <strong>__spec__</strong> = ModuleSpec(name='weakref', loader=&lt;_frozen_impor...a55a80&gt;, origin='/usr/lib/python3.10/weakref.py')</td></tr></table>
887
+ <strong>__spec__</strong> = ModuleSpec(name='weakref', loader=&lt;_frozen_impor...fe0e80&gt;, origin='/usr/lib/python3.10/weakref.py')</td></tr></table>
888
888
  </body></html>
@@ -21,4 +21,4 @@ def main( ):
21
21
  dispatcher.send( signal=SIGNAL2, sender=second_sender, moo='this' )
22
22
 
23
23
  if __name__ == "__main__":
24
- main()
24
+ main()
@@ -15,4 +15,4 @@ def main( ):
15
15
  dispatcher.send( signal=SIGNAL, sender=second_sender )
16
16
 
17
17
  if __name__ == "__main__":
18
- main()
18
+ main()
@@ -75,4 +75,4 @@ if __name__ == "__main__":
75
75
  signal = DO_SOMETHING_ELSE,
76
76
  sender = ourObjects[0],
77
77
  table = "Table Argument",
78
- )
78
+ )
@@ -1,5 +1,6 @@
1
1
  """Multi-consumer multi-producer dispatching mechanism
2
2
  """
3
- __version__ = "2.0.7"
3
+ __version__ = "2.0.9a1"
4
4
  __author__ = "Patrick K. O'Brien"
5
+ __maintainer__ = "Mike C. Fletcher"
5
6
  __license__ = "BSD"