Skip to content

Commit e8639d4

Browse files
committed
update doc
1 parent 7a5e376 commit e8639d4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

doc/features.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2977,12 +2977,16 @@ The core idea can be expressed in fewer than 100 lines of Python; ours is (as of
29772977
29782978
**Changed in v0.14.3**. *The multiple-dispatch decorator `@generic` no longer takes a master definition. Methods are registered directly with `@generic`; the first method definition implicitly creates the generic function.*
29792979
2980-
**Changed in v0.14.3** *The `@generic` and `@typed` decorators can now decorate also instance methods, class methods and static methods (beside regular functions, as previously in 0.14.2).*
2980+
**Changed in v0.14.3**. *The `@generic` and `@typed` decorators can now decorate also instance methods, class methods and static methods (beside regular functions, as previously in 0.14.2).*
2981+
2982+
**Changed in v0.15.0**. *The `dispatch` and `typecheck` modules providing this functionality are now considered stable (no longer experimental). Added the `@generic_for` parametric decorator that can register a new method on an existing generic function originally defined in another lexical scope.*
29812983
29822984
The ``generic`` decorator allows creating multiple-dispatch generic functions with type annotation syntax.
29832985
29842986
We also provide some friendly utilities: ``typed`` creates a single-method generic with the same syntax (i.e. provides a compact notation for writing dynamic type checking code), and ``isoftype`` (which powers the first two) is the big sister of ``isinstance``, with support for many (but unfortunately not all) features of the ``typing`` standard library module.
29852987
2988+
For what kind of things can be done with this, see particularly the [*holy traits*](https://ahsmart.com/pub/holy-traits-design-patterns-and-best-practice-book/) example in [`unpythonic.test.test_dispatch`](../unpythonic/test/test_dispatch.py).
2989+
29862990
#### ``generic``: multiple dispatch with type annotation syntax
29872991
29882992
The ``generic`` decorator essentially allows replacing the `if`/`elif` dynamic type checking boilerplate of polymorphic functions with type annotations on the function parameters, with support for features from the `typing` stdlib module.

0 commit comments

Comments
 (0)