Skip to content

Commit

Permalink
Release 9.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jfhbrook committed Jan 18, 2022
1 parent d009957 commit 94a6d54
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
2022/01/18 Version 9.0.3
------------------------

- Improve type safety of ``EventEmitter#on``, ``EventEmitter#add_listener``
and ``EventEmitter#listens_to`` by parameterizing the ``Handler``
- Minor fixes to documentation

2022/01/17 Version 9.0.2
------------------------

- Add ``tests_require`` to setup.py (attempt to fix COPR build)
- Add ``tests_require`` to setup.py, fixing COPR build
- Install as an editable package in ``environment.yml`` and
``requirements_docs.txt``, fixing Conda workflows and ReadTheDocs
respectively

2022/01/17 Version 9.0.1
------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# built documents.
#
# The short X.Y version.
version = "9.0.2"
version = "9.0.3"

# The full version, including alpha/beta/rc tags.
release = version
Expand Down
15 changes: 10 additions & 5 deletions pyee/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def data_handler(data):

def listens_to(self, event: str) -> Callable[[Handler], Handler]:
"""Returns a decorator which will register the decorated function to
the event name ``event``. Usage::
the event name ``event``::
@ee.listens_to("event")
def data_handler(data):
Expand All @@ -95,10 +95,15 @@ def on(f: Handler) -> Handler:
return on

def add_listener(self, event: str, f: Handler) -> Handler:
"""Register the function ``f`` to the event name ``event``. This method
doesn't afford a narrower return type than ``EventEmitter#on`` but is a
natural pair to ``EventEmitter#listens_to`` and if nothing else has
stricter arguments and simpler behavior.
"""Register the function ``f`` to the event name ``event``::
def data_handler(data):
print(data)
h = ee.add_listener("event", data_handler)
By not supporting the decorator use case, this method has improved
type safety over ``EventEmitter#on``.
"""
self._add_event_handler(event, f, f)
return f
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="pyee",
version="9.0.2",
version="9.0.3",
packages=find_packages(),
include_package_data=True,
description="A port of node.js's EventEmitter to python.",
Expand Down

0 comments on commit 94a6d54

Please sign in to comment.