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 1 of 4

2.2.0

-----

**Release**: 2024-10-24

* ``PriorityCallback`` now has type checking support, similar to ``Callback``, with type checked variants: ``PriorityCallback0``, ``PriorityCallback1``, etc (`128`_).
* ``UnregisterContext`` is now public, meant to be used in type annotations.
* Python 3.10+ is now required.

.. _128: https://github.com/ESSS/oop-ext/pull/128

2.1.0

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

* 48: New type-checker friendly ``proxy = GetProxy(I, obj)`` function as an alternative to ``proxy = I(obj)``. The
latter is not accepted by type checkers in general because interfaces are protocols, which can't be instantiated.

Also fixed a type-checking error with ``AsssertImplements``::

Only concrete class can be given where "Type[Interface]" is expected

This happens due to `python/mypy5374 <https://github.com/python/mypy/issues/5374>`__.

2.0.0

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

* 47: Interfaces no longer check type annotations at all.

It was supported initially, but in practice
this feature has shown up to be an impediment to adopting type annotations incrementally, as it
discourages adding type annotations to improve existing interfaces, or annotating
existing implementations without having to update the interface (and all other implementations
by consequence).

It was decided to let the static type checker correctly deal with matching type annotations, as
it can do so more accurately than ``oop-ext`` did before.

1.2.0

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

* 43: Fix support for type annotated ``Attribute`` and ``ReadOnlyAttribute``:

.. code-block:: python

class IFoo(Interface):
value: int = Attribute(int)

1.1.2

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

* 41: Fix regression introduced in ``1.1.0`` where installing a callback using
``callback.After`` or ``callback.Before`` would make a method no longer compliant with
the signature required by its interface.

1.1.1

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

* 38: Reintroduce ``extra_args`` argument to ``Callback._GetKey``, so subclasses can make use
of it.

* 36: Fix regression introduced in ``1.1.0`` where ``Abstract`` and ``Implements`` decorators
could no longer be used in interfaces implementations.

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.