Oop-ext

Latest version: v2.2.0

Safety actively analyzes 682387 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

1.1.0

------------------

* 25: ``oop-ext`` now includes inline type annotations and exposes them to user programs.

If you are running a type checker such as mypy on your tests, you may start noticing type errors indicating incorrect usage.
If you run into an error that you believe to be incorrect, please let us know in an issue.

The types were developed against ``mypy`` version 0.800.

* 26: New type-checked ``Callback`` variants, ``Callback0``, ``Callback1``, ``Callback2``, etc, providing
type checking for all operations(calling, ``Register``, etc) at nearly zero runtime cost.

Example:

.. code-block:: python

from oop_ext.foundation.callback import Callback2


def changed(x: int, v: float) -> None: ...


on_changed = Callback2[int, float]()
on_changed(10, 5.25)


* Fixed ``Callbacks.Before`` and ``Callbacks.After`` signatures: previously their signature conveyed
that they supported multiple callbacks, but it was a mistake which would break callers because
every parameter after the 2nd would be considered the ``sender_as_parameter`` parameter, which
was forwarded to ``After`` and ``Before`` functions of the ``_shortcuts.py``
module.

1.0.0

------------------

* ``Callbacks`` can be used as context manager, which provides a ``Register(callback, function)``,
which automatically unregisters all functions when the context manager ends.

* ``Callback.Register(function)`` now returns an object with a ``Unregister()`` method, which
can be used to undo the register call.

0.6.0

==================

* Change back the default value of ``requires_declaration`` to ``True`` and fix an error (22) where the cache wasn't properly cleared.

0.5.1

------------------

* Fixes an issue (20) where mocked `classmethods` weren't considered a valid method during internal checks.

0.5.0

------------------

* Add optional argument ``requires_declaration`` so users can decide whether or not ``ImplementsInterface`` declarations are necessary.

0.4.0

------------------

* Implementations no longer need to explicitly declare that they declare an interface with ``ImplementsInterface``: the check is done implicitly (and cached) by `AssertImplements` and equivalent functions.

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.