From f86dcc6c8bd9f3899a3457935667b77fc9856484 Mon Sep 17 00:00:00 2001 From: Dmitry Cheryasov Date: Thu, 7 Aug 2008 00:09:32 +0400 Subject: [PATCH] Adds "self" to restored methods even if not in __doc__; closes PY-38. Sorry, no meaningful test yet %) --- python/src/com/jetbrains/python/sdk/generator3.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/src/com/jetbrains/python/sdk/generator3.py b/python/src/com/jetbrains/python/sdk/generator3.py index fc1ce9a87f70..1544ef55020d 100644 --- a/python/src/com/jetbrains/python/sdk/generator3.py +++ b/python/src/com/jetbrains/python/sdk/generator3.py @@ -419,6 +419,12 @@ class ModuleRedeclarator(object): spec = reqargs + [n + v for (n, v) in zip(optargs, optargvals)] else: funcdoc = None + # here we could have an empty spec because the doc comment states so + if p_class and not spec: + spec.append("self") + if sig_note: + sig_note += "; " + sig_note += "added 'self'" self.out("def " + p_name + "(" + ", ".join(spec) + "): # " + sig_note, indent); self.outDocstring(funcdoc, indent+1) self.out("pass", indent+1);