From fbfef43e29d2fe7264ced992d81aa96a0e01547d Mon Sep 17 00:00:00 2001 From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl> Date: Sat, 7 Oct 2017 22:25:19 +0200 Subject: [PATCH] typechk for instmethods --- docs/coding/typechecking.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/coding/typechecking.md b/docs/coding/typechecking.md index e9d0ff26..8173bed8 100644 --- a/docs/coding/typechecking.md +++ b/docs/coding/typechecking.md @@ -5,4 +5,16 @@ Satella typechecking is a complex solution for: * checking type compatibility at runtime If you do `@typed` on a class method, skip the type of self or cls, since Satella will -detect that it's annotating a class method. \ No newline at end of file +detect that it's annotating a class method. + +## Typechecking instance methods + +If you need to use `@typed` for instancemethods, do the following: + +```python +class Cheese(object): + + @typed('self', int, int): + def add_two_ints(self, a, b): + return a+b +``` \ No newline at end of file -- GitLab