Skip to content

Commit f1bbce1

Browse files
authored
Merge pull request #151 from pallets-eco/cleanup-docs
clean up docstrings
2 parents fd8a169 + 8dc19ff commit f1bbce1

File tree

4 files changed

+221
-181
lines changed

4 files changed

+221
-181
lines changed

CHANGES.rst

+24-19
Original file line numberDiff line numberDiff line change
@@ -34,50 +34,55 @@ Released 2023-11-01
3434

3535
- Fixed messages printed to standard error about unraisable exceptions during
3636
signal cleanup, typically during interpreter shutdown. :pr:`123`
37-
- Allow the Signal set_class to be customised, to allow calling of receivers
38-
in registration order. :pr:`116`.
37+
- Allow the Signal ``set_class`` to be customised, to allow calling of
38+
receivers in registration order. :pr:`116`.
3939
- Drop Python 3.7 and support Python 3.12. :pr:`126`
4040

41+
4142
Version 1.6.3
4243
-------------
4344

4445
Released 2023-09-23
4546

46-
- Fix `SyncWrapperType` and `AsyncWrapperType` :pr:`108`
47-
- Fixed issue where ``signal.connected_to`` would not disconnect the
48-
receiver if an instance of ``BaseException`` was raised. :pr:`114`
47+
- Fix ``SyncWrapperType`` and ``AsyncWrapperType`` :pr:`108`
48+
- Fixed issue where ``connected_to`` would not disconnect the receiver if an
49+
instance of ``BaseException`` was raised. :pr:`114`
50+
4951

5052
Version 1.6.2
5153
-------------
5254

5355
Released 2023-04-12
5456

55-
- Type annotations are not evaluated at runtime. typing-extensions is not a runtime
56-
dependency. :pr:`94`
57+
- Type annotations are not evaluated at runtime. typing-extensions is not a
58+
runtime dependency. :pr:`94`
59+
5760

5861
Version 1.6.1
5962
-------------
6063

6164
Released 2023-04-09
6265

63-
- Ensure that py.typed is present in the distributions (to enable other
64-
projects to use blinker's typing).
65-
- Require typing-extensions > 4.2 to ensure it includes
66-
ParamSpec. :issue:`90`
66+
- Ensure that ``py.typed`` is present in the distributions (to enable other
67+
projects to use Blinker's typing).
68+
- Require typing-extensions > 4.2 to ensure it includes ``ParamSpec``.
69+
:issue:`90`
70+
6771

6872
Version 1.6
6973
-----------
7074

7175
Released 2023-04-02
7276

73-
- Add a muted context manager to temporarily turn off a
74-
signal. :pr:`84`
75-
- Allow int senders (alongside existing string senders). :pr:`83`
76-
- Add a send_async method to the Signal to allow signals to send to
77-
coroutine receivers. :pr:`76`
78-
- Update and modernise the project structure to match that used by the
79-
pallets projects. :pr:`77`
80-
- Add an intial set of type hints for the project.
77+
- Add a ``muted`` context manager to temporarily turn off a signal. :pr:`84`
78+
- ``int`` instances with the same value will be treated as the same sender,
79+
the same as ``str`` instances. :pr:`83`
80+
- Add a ``send_async`` method to allow signals to send to coroutine receivers.
81+
:pr:`76`
82+
- Update and modernise the project structure to match that used by the Pallets
83+
projects. :pr:`77`
84+
- Add an initial set of type hints for the project.
85+
8186

8287
Version 1.5
8388
-----------

docs/conf.py

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"sphinxcontrib.log_cabinet",
1313
"pallets_sphinx_themes",
1414
]
15-
autoclass_content = "both"
1615
autodoc_member_order = "groupwise"
1716
autodoc_typehints = "description"
1817
autodoc_preserve_defaults = True

docs/index.rst

+20-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Blinker Documentation
66
.. image:: _static/blinker-named.png
77
:align: center
88

9+
.. currentmodule:: blinker
10+
911
Blinker provides fast & simple object-to-object and broadcast
1012
signaling for Python objects.
1113

@@ -357,27 +359,38 @@ All public API members can (and should) be imported from ``blinker``::
357359

358360
from blinker import ANY, signal
359361

360-
.. currentmodule:: blinker.base
361-
362362
Basic Signals
363363
+++++++++++++
364364

365-
.. autodata:: blinker.base.ANY
365+
.. data:: ANY
366+
367+
Symbol for "any sender".
366368

367369
.. autoclass:: Signal
368370
:members:
369-
:undoc-members:
370371

371372
Named Signals
372373
+++++++++++++
373374

374-
.. autofunction:: signal
375+
.. function:: signal(name, doc=None)
376+
377+
Return a :class:`NamedSignal` in :data:`default_namespace` for the given
378+
name, creating it if required. Repeated calls with the same name return the
379+
same signal.
375380

376-
.. autodata:: default_namespace
381+
:param name: The name of the signal.
382+
:type name: str
383+
:param doc: The docstring of the signal.
384+
:type doc: str | None
385+
:rtype: NamedSignal
386+
387+
.. data:: default_namespace
388+
389+
A default :class:`Namespace` for creating named signals. :func:`signal`
390+
creates a :class:`NamedSignal` in this namespace.
377391

378392
.. autoclass:: NamedSignal
379393
:show-inheritance:
380-
:members:
381394

382395
.. autoclass:: Namespace
383396
:show-inheritance:

0 commit comments

Comments
 (0)