From a36e39a76b6fc40760f7375a22195f65d00e73ed Mon Sep 17 00:00:00 2001
From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl>
Date: Mon, 14 Aug 2017 10:48:26 +0200
Subject: [PATCH] again

---
 satella/coding/typecheck.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/satella/coding/typecheck.py b/satella/coding/typecheck.py
index dbeb2879..a0f134e3 100644
--- a/satella/coding/typecheck.py
+++ b/satella/coding/typecheck.py
@@ -278,10 +278,12 @@ def typed(*t_args, **t_kwargs):
         @functools.wraps(fun)
         def inner(*args, **kwargs):
 
-            if inspect.ismethod(fun):   # instancemethod or classmethod
-                cargs = args[1:]
-            else:
+            try:
+                fun.im_class
+            except AttributeError:
                 cargs = args
+            else:
+                cargs = args[1:]
 
             for argument, typedescr in zip(cargs, t_args):
                 if typedescr is not None:
-- 
GitLab