Skip to content
Snippets Groups Projects
Commit fbfef43e authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

typechk for instmethods

parent 27862e6e
No related branches found
No related tags found
No related merge requests found
...@@ -5,4 +5,16 @@ Satella typechecking is a complex solution for: ...@@ -5,4 +5,16 @@ Satella typechecking is a complex solution for:
* checking type compatibility at runtime * checking type compatibility at runtime
If you do `@typed` on a class method, skip the type of self or cls, since Satella will 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. detect that it's annotating a class method.
\ No newline at end of file
## 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment